﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1Command;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_TraHangNhaCungCap : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvNhaCungCap")]
        private ADVObjects _AdvNhaCungCap;
        [AccessedThroughProperty("AdvTaiKhoanNo")]
        private ADVAccount _AdvTaiKhoanNo;
        [AccessedThroughProperty("AdvTaiKhoanThue")]
        private ADVAccount _AdvTaiKhoanThue;
        [AccessedThroughProperty("C1DockingTab1")]
        private C1DockingTab _C1DockingTab1;
        [AccessedThroughProperty("C1DockingTab2")]
        private C1DockingTab _C1DockingTab2;
        [AccessedThroughProperty("C1DockingTabPage1")]
        private C1DockingTabPage _C1DockingTabPage1;
        [AccessedThroughProperty("C1DockingTabPage2")]
        private C1DockingTabPage _C1DockingTabPage2;
        [AccessedThroughProperty("C1DockingTabPage3")]
        private C1DockingTabPage _C1DockingTabPage3;
        [AccessedThroughProperty("CboLoaiHoaDon")]
        private ComboBox _CboLoaiHoaDon;
        [AccessedThroughProperty("CboLoaiIn")]
        private ComboBox _CboLoaiIn;
        [AccessedThroughProperty("CboLoaiTien")]
        private ComboBox _CboLoaiTien;
        [AccessedThroughProperty("CmdAdd")]
        private ToolStripButton _CmdAdd;
        [AccessedThroughProperty("CmdAddRow")]
        private Button _CmdAddRow;
        [AccessedThroughProperty("CmdBoGhiSo")]
        private ToolStripButton _CmdBoGhiSo;
        [AccessedThroughProperty("CmdDel")]
        private ToolStripButton _CmdDel;
        [AccessedThroughProperty("CmdDelRow")]
        private Button _CmdDelRow;
        [AccessedThroughProperty("CmdDTThue")]
        private Button _CmdDTThue;
        [AccessedThroughProperty("CmdEdit")]
        private ToolStripButton _CmdEdit;
        [AccessedThroughProperty("CmdExit")]
        private ToolStripButton _CmdExit;
        [AccessedThroughProperty("CmdFind")]
        private ToolStripButton _CmdFind;
        [AccessedThroughProperty("CmdGhiSo")]
        private ToolStripButton _CmdGhiSo;
        [AccessedThroughProperty("CmdPrint")]
        private ToolStripDropDownButton _CmdPrint;
        [AccessedThroughProperty("CmdSave")]
        private ToolStripButton _CmdSave;
        [AccessedThroughProperty("CmdSearchPhieuNhap")]
        private Button _CmdSearchPhieuNhap;
        [AccessedThroughProperty("CmdTimNhapKhau")]
        private ToolStripMenuItem _CmdTimNhapKhau;
        [AccessedThroughProperty("CmdTimNhapKho")]
        private ToolStripMenuItem _CmdTimNhapKho;
        [AccessedThroughProperty("CmdTimPhieuNhap")]
        private ContextMenuStrip _CmdTimPhieuNhap;
        [AccessedThroughProperty("CmdUnsave")]
        private ToolStripButton _CmdUnsave;
        [AccessedThroughProperty("GrpHoaDon")]
        private GroupBox _GrpHoaDon;
        [AccessedThroughProperty("InPhieuTraHangToolStripMenuItem")]
        private ToolStripMenuItem _InPhieuTraHangToolStripMenuItem;
        [AccessedThroughProperty("InToolStripMenuItem")]
        private ToolStripMenuItem _InToolStripMenuItem;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label10")]
        private Label _Label10;
        [AccessedThroughProperty("Label11")]
        private Label _Label11;
        [AccessedThroughProperty("Label12")]
        private Label _Label12;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label14")]
        private Label _Label14;
        [AccessedThroughProperty("Label15")]
        private Label _Label15;
        [AccessedThroughProperty("Label16")]
        private Label _Label16;
        [AccessedThroughProperty("Label17")]
        private Label _Label17;
        [AccessedThroughProperty("Label18")]
        private Label _Label18;
        [AccessedThroughProperty("Label19")]
        private Label _Label19;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label20")]
        private Label _Label20;
        [AccessedThroughProperty("Label21")]
        private Label _Label21;
        [AccessedThroughProperty("Label22")]
        private Label _Label22;
        [AccessedThroughProperty("Label23")]
        private Label _Label23;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label35")]
        private Label _Label35;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("Label6")]
        private Label _Label6;
        [AccessedThroughProperty("Label7")]
        private Label _Label7;
        [AccessedThroughProperty("Label8")]
        private Label _Label8;
        [AccessedThroughProperty("Label9")]
        private Label _Label9;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("TabDetails")]
        private C1DockingTab _TabDetails;
        [AccessedThroughProperty("ToolStrip1")]
        private ToolStrip _ToolStrip1;
        [AccessedThroughProperty("ToolStripButton1")]
        private ToolStripSeparator _ToolStripButton1;
        [AccessedThroughProperty("ToolStripButton2")]
        private ToolStripButton _ToolStripButton2;
        [AccessedThroughProperty("ToolStripSeparator1")]
        private ToolStripSeparator _ToolStripSeparator1;
        [AccessedThroughProperty("ToolStripSeparator2")]
        private ToolStripSeparator _ToolStripSeparator2;
        [AccessedThroughProperty("ToolStripSeparator3")]
        private ToolStripSeparator _ToolStripSeparator3;
        [AccessedThroughProperty("TxtChietKhau")]
        private C1NumericEdit _TxtChietKhau;
        [AccessedThroughProperty("TxtChietKhauNT")]
        private C1NumericEdit _TxtChietKhauNT;
        [AccessedThroughProperty("TxtDiaChiThue")]
        private TextBox _TxtDiaChiThue;
        [AccessedThroughProperty("TxtDienGiai")]
        private TextBox _TxtDienGiai;
        [AccessedThroughProperty("txtHinhThucThanhToan")]
        private TextBox _txtHinhThucThanhToan;
        [AccessedThroughProperty("txtMauHoaDon")]
        private TextBox _txtMauHoaDon;
        [AccessedThroughProperty("txtMST")]
        private TextBox _txtMST;
        [AccessedThroughProperty("TxtNgayChungTu")]
        private DateTimePicker _TxtNgayChungTu;
        [AccessedThroughProperty("TxtNgayChungTuNhap")]
        private DateTimePicker _TxtNgayChungTuNhap;
        [AccessedThroughProperty("TxtNgayHoaDon")]
        private DateTimePicker _TxtNgayHoaDon;
        [AccessedThroughProperty("TxtSoChungTu")]
        private TextBox _TxtSoChungTu;
        [AccessedThroughProperty("TxtSoChungTuNhap")]
        private TextBox _TxtSoChungTuNhap;
        [AccessedThroughProperty("TxtSoHoaDon")]
        private TextBox _TxtSoHoaDon;
        [AccessedThroughProperty("TxtSoSeri")]
        private TextBox _TxtSoSeri;
        [AccessedThroughProperty("TxtTenDoiTuongThue")]
        private TextBox _TxtTenDoiTuongThue;
        [AccessedThroughProperty("TxtThueSuat")]
        private C1NumericEdit _TxtThueSuat;
        [AccessedThroughProperty("TxtTienHang")]
        private C1NumericEdit _TxtTienHang;
        [AccessedThroughProperty("TxtTienHangNT")]
        private C1NumericEdit _TxtTienHangNT;
        [AccessedThroughProperty("TxtTienThue")]
        private C1NumericEdit _TxtTienThue;
        [AccessedThroughProperty("TxtTienThueNT")]
        private C1NumericEdit _TxtTienThueNT;
        [AccessedThroughProperty("TxtTongThanhToan")]
        private C1NumericEdit _TxtTongThanhToan;
        [AccessedThroughProperty("TxtTongThanhToanNT")]
        private C1NumericEdit _TxtTongThanhToanNT;
        [AccessedThroughProperty("txtTyGia")]
        private C1NumericEdit _txtTyGia;
        [AccessedThroughProperty("VSlist")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlist;
        private string cFrmFormat;
        private int cFrmGhiSo;
        public string cFrmKhoa;
        private string cFrmKhoaOld;
        private string cFrmTask;
        private IContainer components;
        private bool isLoaded;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private bool mEnabledControl;
        private string mLoaiChungTu;
        private clsDMDonViTinh objDVT;
        private clsXuatKhoChiTiet objHDCT;
        private clsDMHangHoa objHH;
        private clsNhapKho objNK;
        private clsSoChungTu objSoCT;
        private clsXuatKho objTH;
        private clsNhapKhoChiTiet objTHCT;
        private DataTable pdt;

        public Frm_TraHangNhaCungCap()
        {
            base.KeyDown += new KeyEventHandler(this.Frm_XuatBan_KeyDown);
            base.Load += new EventHandler(this.Frm_XuatBan_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.mLoaiChungTu = "THCC";
            this.objSoCT = new clsSoChungTu();
            this.cFrmKhoa = "";
            this.cFrmKhoaOld = "";
            this.objHH = new clsDMHangHoa();
            this.objDVT = new clsDMDonViTinh();
            this.objTH = new clsXuatKho();
            this.objTHCT = new clsNhapKhoChiTiet();
            this.objHDCT = new clsXuatKhoChiTiet();
            this.objNK = new clsNhapKho();
            this.cFrmGhiSo = 0;
            this.cFrmTask = "";
            this.isLoaded = false;
            this.InitializeComponent();
        }

        private void AdvNhaCungCap_ValueChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.AdvNhaCungCap.Value, "", modGeneral.TypeOfValue.Nothing).ToString() != "")
            {
                clsDMDoiTuong tuong = new clsDMDoiTuong();
                tuong.Load(this.AdvNhaCungCap.Value);
                if (modGeneral.H_LANGUAGE == "VIET")
                {
                    this.TxtTenDoiTuongThue.Text = tuong.TenViet.Trim();
                }
                else
                {
                    this.TxtTenDoiTuongThue.Text = tuong.TenAnh.Trim();
                }
                this.txtMST.Text = tuong.MaSoThue;
            }
        }

        private void CboLoaiHoaDon_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.mEnabledControl && (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiHoaDon.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() != ""))
            {
                clsDMLoaiHoaDon don = new clsDMLoaiHoaDon();
                don.Load(Conversions.ToString(this.CboLoaiHoaDon.SelectedValue));
                this.TxtThueSuat.Value = don.TyLeThue;
            }
        }

        private void CboLoaiIn_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.CboLoaiIn.SelectedValue.ToString().Trim() == "DI")
            {
                this.GrpHoaDon.Enabled = true;
            }
            else if (this.CboLoaiIn.SelectedValue.ToString().Trim() == "TI")
            {
                this.GrpHoaDon.Enabled = false;
            }
        }

        private void CboLoaiTien_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                this.txtTyGia.Value = 0;
            }
            else
            {
                string strCode = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim();
                if (strCode != "")
                {
                    clsDMLoaiTien tien = new clsDMLoaiTien();
                    tien.LoadByCode(strCode);
                    if (tien.SoLe > 0)
                    {
                        this.cFrmFormat = modGeneral.H_FORMATNUMBER + "." + LVYModule.sRight("##########", tien.SoLe);
                    }
                    if (tien.TienViet == 1)
                    {
                        this.txtTyGia.Enabled = false;
                    }
                    this.txtTyGia.Value = tien.TyGia;
                    this.FormatNumber();
                }
            }
        }

        public bool CheckGrid()
        {
            if (this.VSlist.Rows.Count == 1)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập h\x00e0ng h\x00f3a trả lại!", ""));
                this.CmdAddRow.Focus();
                return false;
            }
            return true;
        }

        public bool CheckIvalid()
        {
            if (LVYModule.ReturnIfNull(this.TxtSoChungTu.Text, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số chứng từ!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (this.objTH.IsDuplicateVoucherNo(this.TxtSoChungTu.Text, this.cFrmKhoa))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ n\x00e0y đ\x00e3 tồn tại, bạn h\x00e3y nhập số chứng từ kh\x00e1c!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(this.AdvNhaCungCap.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập kh\x00e1ch h\x00e0ng mua h\x00e0ng!", ""));
                this.AdvNhaCungCap.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn loại tiền!", ""));
                this.CboLoaiTien.Focus();
                return false;
            }
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing)) == 0.0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập tỷ gi\x00e1 nguy\x00ean tệ!", ""));
                this.txtTyGia.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiHoaDon.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn loại h\x00f3a đơn!", ""));
                this.txtTyGia.Focus();
                return false;
            }
            if (!this.CheckGrid())
            {
                return false;
            }
            return true;
        }

        private void CmdAdd_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
            }
            this.EmptyData();
            this.cFrmKhoa = modGeneral.CreatKey("ST_XuatTraHang", 15, "TH");
            this.objSoCT.Load(this.mLoaiChungTu);
            this.TxtSoChungTu.Text = this.objSoCT.CreateVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), 1);
            this.CboLoaiTien.SelectedValue = modGeneral.H_CURRENCY;
            this.EnabledControl = true;
            this.TxtSoChungTu.Focus();
            this.cFrmTask = "I";
        }

        private void CmdAddRow_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.AdvNhaCungCap.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn kh\x00e1ch h\x00e0ng trước!", ""));
                this.AdvNhaCungCap.Focus();
            }
            else if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn loại tiền!", ""));
                this.CboLoaiTien.Focus();
            }
            else if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiHoaDon.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn loại h\x00f3a đơn!", ""));
                this.CboLoaiTien.Focus();
            }
            else if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoChungTuNhap.Tag), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                MyProject.Forms.Frm_ChonHangTraLai.cFrmKhoaNhapXuat = Conversions.ToString(this.TxtSoChungTuNhap.Tag);
                MyProject.Forms.Frm_ChonHangTraLai.objFrmCall = this;
                MyProject.Forms.Frm_ChonHangTraLai.cfrmLoai = "NK";
                MyProject.Forms.Frm_ChonHangTraLai.cfrmTLThue = Conversions.ToInteger(this.TxtThueSuat.Value);
                MyProject.Forms.Frm_ChonHangTraLai.ShowDialog();
            }
            else if (this.VSlist.Rows.Count < 10)
            {
                this.VSlist.AddItem("");
                this.VSlist.Select(this.VSlist.Rows.Count - 1, 2);
                this.VSlist.Focus();
            }
        }

        private void CmdBoGhiSo_Click(object sender, EventArgs e)
        {
            if (this.objTH.UnRegistered(this.cFrmKhoa))
            {
                this.CmdGhiSo.Visible = true;
                this.CmdBoGhiSo.Visible = false;
                this.CmdEdit.Enabled = this.mAllowEdit;
                this.CmdDel.Enabled = this.mAllowDel;
            }
        }

        private void CmdDel_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                if (this.objNK.WasUsed(this.cFrmKhoa))
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Th\x00f4ng tin h\x00f3a đơn n\x00e0y đ\x00e3 được sử dụng lập trả h\x00e0ng, bạn kh\x00f4ng thể x\x00f3a!", ""));
                }
                else if (LVYModule.ConfirmDelete("") && this.objTH.DeleteData(this.cFrmKhoa, 1))
                {
                    this.EmptyData();
                    this.EnabledControl = false;
                }
            }
        }

        private void CmdDelRow_Click(object sender, EventArgs e)
        {
            if (this.VSlist.Rows.Count != 1)
            {
                this.VSlist.RemoveItem(this.VSlist.Row);
            }
        }

        private void CmdDTThue_Click(object sender, EventArgs e)
        {
            string str;
            string expression = "";
            if (this.mEnabledControl)
            {
                str = "";
            }
            else
            {
                str = "VIEW";
            }
            expression = Conversions.ToString(SearchModule.SearchDoiTuongThue(this.TxtTenDoiTuongThue.Text, this.txtMST.Text, this.TxtDiaChiThue.Text, str));
            if (expression != "")
            {
                object instance = Strings.Split(expression, "|", -1, CompareMethod.Binary);
                this.TxtTenDoiTuongThue.Text = Conversions.ToString(NewLateBinding.LateIndexGet(instance, new object[] { 0 }, null));
                this.txtMST.Text = Conversions.ToString(NewLateBinding.LateIndexGet(instance, new object[] { 1 }, null));
                this.TxtDiaChiThue.Text = Conversions.ToString(NewLateBinding.LateIndexGet(instance, new object[] { 2 }, null));
            }
        }

        private void CmdEdit_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
                this.cFrmTask = "U";
                this.EnabledControl = true;
            }
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdFind_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_TraHangNhaCungCapList.Dispose();
            MyProject.Forms.Frm_TraHangNhaCungCapList.Show();
            MyProject.Forms.Frm_TraHangNhaCungCapList.BringToFront();
        }

        private void CmdGhiSo_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_GhiSoTraHangNhaCungCap.cFrmKhoa = this.cFrmKhoa;
            MyProject.Forms.Frm_GhiSoTraHangNhaCungCap.ShowDialog();
            if (MyProject.Forms.Frm_GhiSoTraHangNhaCungCap.GhiSo)
            {
                this.CmdGhiSo.Visible = false;
                this.CmdBoGhiSo.Visible = true;
                this.CmdEdit.Enabled = false;
                this.CmdDel.Enabled = false;
            }
            else
            {
                this.CmdGhiSo.Visible = true;
                this.CmdBoGhiSo.Visible = false;
                this.CmdEdit.Enabled = true & this.mAllowEdit;
                this.CmdDel.Enabled = true & this.mAllowDel;
            }
        }

        private void CmdPrint_Click(object sender, EventArgs e)
        {
        }

        private void CmdSave_Click(object sender, EventArgs e)
        {
            if (this.CheckIvalid())
            {
                if (!this.SaveHHDetailsTemp())
                {
                    this.objTH.ClearTemp(this.cFrmKhoa);
                }
                else if (Conversions.ToBoolean(Microsoft.VisualBasic.CompilerServices.Operators.NotObject(this.UpdateData())))
                {
                    this.objTH.ClearTemp(this.cFrmKhoa);
                }
                else
                {
                    this.objTH.ClearTemp(this.cFrmKhoa);
                    this.EnabledControl = false;
                    this.cFrmTask = "";
                }
            }
        }

        private void CmdSearchPhieuNhap_Click(object sender, EventArgs e)
        {
            Rectangle displayRectangle = this.CmdSearchPhieuNhap.DisplayRectangle;
            displayRectangle = this.CmdSearchPhieuNhap.RectangleToScreen(displayRectangle);
            Point point = new Point(displayRectangle.Left, displayRectangle.Bottom);
            object obj2 = point;
            object[] objArray = new object[2];
            object instance = obj2;
            objArray[0] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(instance, null, "X", new object[0], null, null, null));
            object obj4 = obj2;
            objArray[1] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(obj4, null, "Y", new object[0], null, null, null));
            object[] arguments = objArray;
            bool[] copyBack = new bool[] { true, true };
            NewLateBinding.LateCall(this.CmdTimPhieuNhap, null, "Show", arguments, null, null, copyBack, true);
            if (copyBack[0])
            {
                NewLateBinding.LateSetComplex(instance, null, "X", new object[] { RuntimeHelpers.GetObjectValue(arguments[0]) }, null, null, true, false);
            }
            if (copyBack[1])
            {
                NewLateBinding.LateSetComplex(obj4, null, "Y", new object[] { RuntimeHelpers.GetObjectValue(arguments[1]) }, null, null, true, false);
            }
        }

        private void CmdTimNhapKhau_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_NhapKhauList.objFrmCall = this;
            MyProject.Forms.Frm_NhapKhauList.ShowDialog();
        }

        private void CmdTimNhapKho_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_NhapKhoList.objFrmCall = this;
            MyProject.Forms.Frm_NhapKhoList.ShowDialog();
        }

        private void CmdUnsave_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoaOld, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.cFrmKhoa = this.cFrmKhoaOld;
                this.ShowData(this.cFrmKhoa);
            }
            else
            {
                this.EmptyData();
            }
            if (this.cFrmTask == "I")
            {
                this.objSoCT.UndoVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6));
            }
            this.cFrmTask = "";
            this.EnabledControl = false;
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        public void EmptyData()
        {
            this.TxtTenDoiTuongThue.Text = "";
            this.TxtSoChungTuNhap.Text = "";
            this.txtMauHoaDon.Text = "";
            this.TxtSoHoaDon.Text = "";
            this.TxtSoSeri.Text = "";
            this.TxtSoChungTu.Text = "";
            this.txtMST.Text = "";
            this.TxtNgayChungTu.Text = Strings.Format(DateAndTime.Today, "dd/MM/yyyy");
            this.CboLoaiTien.SelectedValue = "";
            this.txtTyGia.Value = 0;
            this.TxtDienGiai.Text = "";
            this.AdvTaiKhoanNo.Value = "";
            this.AdvTaiKhoanThue.Value = "";
            this.AdvNhaCungCap.Value = "";
            this.VSlist.Select(0, 0);
            this.VSlist.Rows.Count = 1;
            this.TxtTienHang.Value = 0;
            this.TxtTienHangNT.Value = 0;
            this.TxtChietKhau.Value = 0;
            this.TxtChietKhauNT.Value = 0;
            this.TxtTienThue.Value = 0;
            this.TxtTienThueNT.Value = 0;
            this.TxtTongThanhToan.Value = 0;
            this.TxtTongThanhToanNT.Value = 0;
            this.CboLoaiHoaDon.SelectedValue = "";
            this.TxtThueSuat.Value = 0;
            this.txtHinhThucThanhToan.Text = "";
        }

        public void FormatNumber()
        {
            LVYModule.advFormatNumber(this.txtTyGia, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTienHangNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTienHang, modGeneral.H_FORMATNUMBER);
            LVYModule.advFormatNumber(this.TxtTienThueNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTienThue, modGeneral.H_FORMATNUMBER);
            LVYModule.advFormatNumber(this.TxtTongThanhToanNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtChietKhauNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtChietKhau, modGeneral.H_FORMATNUMBER);
            LVYModule.advFormatNumber(this.TxtTongThanhToan, modGeneral.H_FORMATNUMBER);
        }

        private void Frm_XuatBan_KeyDown(object sender, KeyEventArgs e)
        {
            Keys keyCode = e.KeyCode;
            if (keyCode != Keys.ControlKey)
            {
                if (keyCode == Keys.F2)
                {
                    this.CmdEdit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
                else if (keyCode == Keys.F3)
                {
                    this.CmdFind_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
                else if (keyCode == Keys.F5)
                {
                    this.TabDetails.SelectedIndex = 0;
                }
                else if (keyCode == Keys.F6)
                {
                    this.TabDetails.SelectedIndex = 1;
                }
                else if (keyCode == Keys.F10)
                {
                    this.CmdAdd_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
                else if (keyCode == Keys.F11)
                {
                    this.CmdSave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
                else if (keyCode == Keys.F12)
                {
                    this.CmdUnsave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
        }

        private void Frm_XuatBan_Load(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.EnabledControl = false;
                this.cFrmFormat = modGeneral.H_FORMATNUMBER;
                BuildComboModule.BuildCombo(this.CboLoaiTien, modGeneral.ListDanhMuc.LoaiTien, false, "", "");
                BuildComboModule.BuildCombo(this.CboLoaiHoaDon, modGeneral.ListDanhMuc.LoaiHoaDon, false, " LoaiPhatSinh = 'BR'", "");
                BuildComboModule.BuildCombo(this.CboLoaiIn, modGeneral.ListDanhMuc.LoaiIn, false, "", "");
                if (modGeneral.H_LOAIINMACDINH != "")
                {
                    this.CboLoaiIn.SelectedValue = modGeneral.H_LOAIINMACDINH;
                }
                this.isLoaded = false;
                if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    this.EmptyData();
                }
                else
                {
                    this.ShowData(this.cFrmKhoa);
                }
                this.isLoaded = true;
                this.Cursor = Cursors.Default;
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_TraHangNhaCungCap));
            this.TxtTienHangNT = new C1NumericEdit();
            this.TxtChietKhauNT = new C1NumericEdit();
            this.TxtTienThue = new C1NumericEdit();
            this.TxtTienHang = new C1NumericEdit();
            this.TxtChietKhau = new C1NumericEdit();
            this.ToolStripSeparator2 = new ToolStripSeparator();
            this.Label22 = new Label();
            this.Label21 = new Label();
            this.Label5 = new Label();
            this.TxtTongThanhToanNT = new C1NumericEdit();
            this.TxtTongThanhToan = new C1NumericEdit();
            this.Label23 = new Label();
            this.TxtTienThueNT = new C1NumericEdit();
            this.ToolStripSeparator1 = new ToolStripSeparator();
            this.CmdExit = new ToolStripButton();
            this.CmdDel = new ToolStripButton();
            this.CmdDelRow = new Button();
            this.ToolStripButton2 = new ToolStripButton();
            this.CmdAddRow = new Button();
            this.CmdAdd = new ToolStripButton();
            this.ToolStripButton1 = new ToolStripSeparator();
            this.ToolStripSeparator3 = new ToolStripSeparator();
            this.CmdEdit = new ToolStripButton();
            this.CmdFind = new ToolStripButton();
            this.CmdSave = new ToolStripButton();
            this.CmdUnsave = new ToolStripButton();
            this.CmdSearchPhieuNhap = new Button();
            this.Label4 = new Label();
            this.TxtNgayChungTuNhap = new DateTimePicker();
            this.Label20 = new Label();
            this.Label16 = new Label();
            this.Label6 = new Label();
            this.TxtSoChungTuNhap = new TextBox();
            this.TxtDienGiai = new TextBox();
            this.Label9 = new Label();
            this.CboLoaiTien = new ComboBox();
            this.txtTyGia = new C1NumericEdit();
            this.Label11 = new Label();
            this.Label10 = new Label();
            this.Label2 = new Label();
            this.Label13 = new Label();
            this.TxtNgayChungTu = new DateTimePicker();
            this.Label1 = new Label();
            this.TxtSoChungTu = new TextBox();
            this.ToolStrip1 = new ToolStrip();
            this.CmdPrint = new ToolStripDropDownButton();
            this.InPhieuTraHangToolStripMenuItem = new ToolStripMenuItem();
            this.InToolStripMenuItem = new ToolStripMenuItem();
            this.CmdGhiSo = new ToolStripButton();
            this.CmdBoGhiSo = new ToolStripButton();
            this.CmdTimPhieuNhap = new ContextMenuStrip(this.components);
            this.CmdTimNhapKho = new ToolStripMenuItem();
            this.CmdTimNhapKhau = new ToolStripMenuItem();
            this.TabDetails = new C1DockingTab();
            this.C1DockingTabPage2 = new C1DockingTabPage();
            this.VSlist = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.C1DockingTab1 = new C1DockingTab();
            this.C1DockingTabPage1 = new C1DockingTabPage();
            this.Label19 = new Label();
            this.txtHinhThucThanhToan = new TextBox();
            this.Label18 = new Label();
            this.TxtThueSuat = new C1NumericEdit();
            this.TxtDiaChiThue = new TextBox();
            this.GrpHoaDon = new GroupBox();
            this.CmdDTThue = new Button();
            this.TxtTenDoiTuongThue = new TextBox();
            this.Label17 = new Label();
            this.Label8 = new Label();
            this.Label14 = new Label();
            this.txtMST = new TextBox();
            this.Label3 = new Label();
            this.Label12 = new Label();
            this.TxtNgayHoaDon = new DateTimePicker();
            this.TxtSoSeri = new TextBox();
            this.txtMauHoaDon = new TextBox();
            this.TxtSoHoaDon = new TextBox();
            this.Label15 = new Label();
            this.Label7 = new Label();
            this.CboLoaiHoaDon = new ComboBox();
            this.AdvTaiKhoanThue = new ADVAccount();
            this.AdvNhaCungCap = new ADVObjects();
            this.AdvTaiKhoanNo = new ADVAccount();
            this.C1DockingTab2 = new C1DockingTab();
            this.C1DockingTabPage3 = new C1DockingTabPage();
            this.CboLoaiIn = new ComboBox();
            this.Label35 = new Label();
            this.Panel1 = new Panel();
            ((ISupportInitialize) this.TxtTienHangNT).BeginInit();
            ((ISupportInitialize) this.TxtChietKhauNT).BeginInit();
            ((ISupportInitialize) this.TxtTienThue).BeginInit();
            ((ISupportInitialize) this.TxtTienHang).BeginInit();
            ((ISupportInitialize) this.TxtChietKhau).BeginInit();
            ((ISupportInitialize) this.TxtTongThanhToanNT).BeginInit();
            ((ISupportInitialize) this.TxtTongThanhToan).BeginInit();
            ((ISupportInitialize) this.TxtTienThueNT).BeginInit();
            ((ISupportInitialize) this.txtTyGia).BeginInit();
            this.ToolStrip1.SuspendLayout();
            this.CmdTimPhieuNhap.SuspendLayout();
            ((ISupportInitialize) this.TabDetails).BeginInit();
            this.TabDetails.SuspendLayout();
            this.C1DockingTabPage2.SuspendLayout();
            this.VSlist.BeginInit();
            ((ISupportInitialize) this.C1DockingTab1).BeginInit();
            this.C1DockingTab1.SuspendLayout();
            this.C1DockingTabPage1.SuspendLayout();
            ((ISupportInitialize) this.TxtThueSuat).BeginInit();
            this.GrpHoaDon.SuspendLayout();
            ((ISupportInitialize) this.C1DockingTab2).BeginInit();
            this.C1DockingTab2.SuspendLayout();
            this.C1DockingTabPage3.SuspendLayout();
            this.Panel1.SuspendLayout();
            this.SuspendLayout();
            this.TxtTienHangNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienHangNT.DataType = typeof(double);
            this.TxtTienHangNT.FormatType = FormatTypeEnum.Currency;
            Point point = new Point(0x2a2, 5);
            this.TxtTienHangNT.Location = point;
            this.TxtTienHangNT.Name = "TxtTienHangNT";
            this.TxtTienHangNT.ReadOnly = true;
            Size size = new Size(0x69, 0x12);
            this.TxtTienHangNT.Size = size;
            this.TxtTienHangNT.TabIndex = 2;
            this.TxtTienHangNT.Tag = null;
            this.TxtTienHangNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTienHangNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtChietKhauNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtChietKhauNT.DataType = typeof(double);
            this.TxtChietKhauNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x2a2, 0x1a);
            this.TxtChietKhauNT.Location = point;
            this.TxtChietKhauNT.Name = "TxtChietKhauNT";
            this.TxtChietKhauNT.ReadOnly = true;
            size = new Size(0x69, 0x12);
            this.TxtChietKhauNT.Size = size;
            this.TxtChietKhauNT.TabIndex = 4;
            this.TxtChietKhauNT.Tag = null;
            this.TxtChietKhauNT.TextAlign = HorizontalAlignment.Right;
            this.TxtChietKhauNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienThue.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienThue.DataType = typeof(double);
            this.TxtTienThue.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x30e, 0x2f);
            this.TxtTienThue.Location = point;
            this.TxtTienThue.Name = "TxtTienThue";
            this.TxtTienThue.ReadOnly = true;
            size = new Size(0x69, 0x12);
            this.TxtTienThue.Size = size;
            this.TxtTienThue.TabIndex = 7;
            this.TxtTienThue.Tag = null;
            this.TxtTienThue.TextAlign = HorizontalAlignment.Right;
            this.TxtTienThue.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienHang.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienHang.DataType = typeof(double);
            this.TxtTienHang.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x30e, 5);
            this.TxtTienHang.Location = point;
            this.TxtTienHang.Name = "TxtTienHang";
            this.TxtTienHang.ReadOnly = true;
            size = new Size(0x69, 0x12);
            this.TxtTienHang.Size = size;
            this.TxtTienHang.TabIndex = 3;
            this.TxtTienHang.Tag = null;
            this.TxtTienHang.TextAlign = HorizontalAlignment.Right;
            this.TxtTienHang.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtChietKhau.BorderStyle = BorderStyle.FixedSingle;
            this.TxtChietKhau.DataType = typeof(double);
            this.TxtChietKhau.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x30e, 0x1a);
            this.TxtChietKhau.Location = point;
            this.TxtChietKhau.Name = "TxtChietKhau";
            this.TxtChietKhau.ReadOnly = true;
            size = new Size(0x69, 0x12);
            this.TxtChietKhau.Size = size;
            this.TxtChietKhau.TabIndex = 5;
            this.TxtChietKhau.Tag = null;
            this.TxtChietKhau.TextAlign = HorizontalAlignment.Right;
            this.TxtChietKhau.VisibleButtons = DropDownControlButtonFlags.None;
            this.ToolStripSeparator2.Name = "ToolStripSeparator2";
            size = new Size(6, 0x19);
            this.ToolStripSeparator2.Size = size;
            this.Label22.AutoSize = true;
            this.Label22.BackColor = Color.Transparent;
            point = new Point(0x23c, 50);
            this.Label22.Location = point;
            this.Label22.Name = "Label22";
            size = new Size(0x34, 13);
            this.Label22.Size = size;
            this.Label22.TabIndex = 0x75;
            this.Label22.Text = "Tiền thuế";
            this.Label21.AutoSize = true;
            this.Label21.BackColor = Color.Transparent;
            point = new Point(0x23c, 30);
            this.Label21.Location = point;
            this.Label21.Name = "Label21";
            size = new Size(0x51, 13);
            this.Label21.Size = size;
            this.Label21.TabIndex = 0x74;
            this.Label21.Text = "Tiền chiết khấu";
            this.Label5.AutoSize = true;
            this.Label5.BackColor = Color.Transparent;
            point = new Point(0x23c, 9);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            size = new Size(0x37, 13);
            this.Label5.Size = size;
            this.Label5.TabIndex = 0x73;
            this.Label5.Text = "Tiền h\x00e0ng";
            this.TxtTongThanhToanNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongThanhToanNT.DataType = typeof(double);
            this.TxtTongThanhToanNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x2a2, 0x44);
            this.TxtTongThanhToanNT.Location = point;
            this.TxtTongThanhToanNT.Name = "TxtTongThanhToanNT";
            this.TxtTongThanhToanNT.ReadOnly = true;
            size = new Size(0x69, 0x12);
            this.TxtTongThanhToanNT.Size = size;
            this.TxtTongThanhToanNT.TabIndex = 8;
            this.TxtTongThanhToanNT.Tag = null;
            this.TxtTongThanhToanNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTongThanhToanNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongThanhToan.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongThanhToan.DataType = typeof(double);
            this.TxtTongThanhToan.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x30e, 0x44);
            this.TxtTongThanhToan.Location = point;
            this.TxtTongThanhToan.Name = "TxtTongThanhToan";
            this.TxtTongThanhToan.ReadOnly = true;
            size = new Size(0x69, 0x12);
            this.TxtTongThanhToan.Size = size;
            this.TxtTongThanhToan.TabIndex = 9;
            this.TxtTongThanhToan.Tag = null;
            this.TxtTongThanhToan.TextAlign = HorizontalAlignment.Right;
            this.TxtTongThanhToan.VisibleButtons = DropDownControlButtonFlags.None;
            this.Label23.AutoSize = true;
            this.Label23.BackColor = Color.Transparent;
            point = new Point(0x23c, 0x47);
            this.Label23.Location = point;
            this.Label23.Name = "Label23";
            size = new Size(0x56, 13);
            this.Label23.Size = size;
            this.Label23.TabIndex = 0x87;
            this.Label23.Text = "Tổng thanh to\x00e1n";
            this.TxtTienThueNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienThueNT.DataType = typeof(double);
            this.TxtTienThueNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x2a2, 0x2f);
            this.TxtTienThueNT.Location = point;
            this.TxtTienThueNT.Name = "TxtTienThueNT";
            this.TxtTienThueNT.ReadOnly = true;
            size = new Size(0x69, 0x12);
            this.TxtTienThueNT.Size = size;
            this.TxtTienThueNT.TabIndex = 6;
            this.TxtTienThueNT.Tag = null;
            this.TxtTienThueNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTienThueNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.ToolStripSeparator1.Name = "ToolStripSeparator1";
            size = new Size(6, 0x19);
            this.ToolStripSeparator1.Size = size;
            this.CmdExit.Alignment = ToolStripItemAlignment.Right;
            this.CmdExit.Image = (Image) manager.GetObject("CmdExit.Image");
            this.CmdExit.ImageTransparentColor = Color.White;
            this.CmdExit.Name = "CmdExit";
            size = new Size(0x3a, 0x16);
            this.CmdExit.Size = size;
            this.CmdExit.Text = "Th&o\x00e1t";
            this.CmdDel.Image = (Image) manager.GetObject("CmdDel.Image");
            this.CmdDel.ImageTransparentColor = Color.White;
            this.CmdDel.Name = "CmdDel";
            size = new Size(0x2f, 0x16);
            this.CmdDel.Size = size;
            this.CmdDel.Text = "&X\x00f3a";
            this.CmdDelRow.Image = (Image) manager.GetObject("CmdDelRow.Image");
            this.CmdDelRow.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x67, 5);
            this.CmdDelRow.Location = point;
            this.CmdDelRow.Name = "CmdDelRow";
            size = new Size(0x55, 0x18);
            this.CmdDelRow.Size = size;
            this.CmdDelRow.TabIndex = 1;
            this.CmdDelRow.Text = "&2.X\x00f3a d\x00f2ng";
            this.CmdDelRow.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.CmdDelRow.UseVisualStyleBackColor = true;
            this.ToolStripButton2.Alignment = ToolStripItemAlignment.Right;
            this.ToolStripButton2.Image = (Image) manager.GetObject("ToolStripButton2.Image");
            this.ToolStripButton2.ImageScaling = ToolStripItemImageScaling.None;
            this.ToolStripButton2.ImageTransparentColor = Color.White;
            this.ToolStripButton2.Name = "ToolStripButton2";
            size = new Size(0x35, 0x16);
            this.ToolStripButton2.Size = size;
            this.ToolStripButton2.Text = "&Help";
            this.CmdAddRow.Image = (Image) manager.GetObject("CmdAddRow.Image");
            this.CmdAddRow.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(8, 5);
            this.CmdAddRow.Location = point;
            this.CmdAddRow.Name = "CmdAddRow";
            size = new Size(0x5d, 0x18);
            this.CmdAddRow.Size = size;
            this.CmdAddRow.TabIndex = 0;
            this.CmdAddRow.Text = "&1.Th\x00eam d\x00f2ng";
            this.CmdAddRow.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.CmdAddRow.UseVisualStyleBackColor = true;
            this.CmdAdd.Image = (Image) manager.GetObject("CmdAdd.Image");
            this.CmdAdd.ImageTransparentColor = Color.White;
            this.CmdAdd.Name = "CmdAdd";
            size = new Size(0x52, 0x16);
            this.CmdAdd.Size = size;
            this.CmdAdd.Text = "&Th\x00eam mới";
            this.ToolStripButton1.Name = "ToolStripButton1";
            size = new Size(6, 0x19);
            this.ToolStripButton1.Size = size;
            this.ToolStripSeparator3.Name = "ToolStripSeparator3";
            size = new Size(6, 0x19);
            this.ToolStripSeparator3.Size = size;
            this.CmdEdit.Image = (Image) manager.GetObject("CmdEdit.Image");
            this.CmdEdit.ImageTransparentColor = Color.White;
            this.CmdEdit.Name = "CmdEdit";
            size = new Size(0x2e, 0x16);
            this.CmdEdit.Size = size;
            this.CmdEdit.Text = "&Sửa";
            this.CmdFind.Image = (Image) manager.GetObject("CmdFind.Image");
            this.CmdFind.ImageTransparentColor = Color.White;
            this.CmdFind.Name = "CmdFind";
            size = new Size(0x4d, 0x16);
            this.CmdFind.Size = size;
            this.CmdFind.Text = "T\x00ecm kiếm";
            this.CmdSave.Image = (Image) manager.GetObject("CmdSave.Image");
            this.CmdSave.ImageTransparentColor = Color.WhiteSmoke;
            this.CmdSave.Name = "CmdSave";
            size = new Size(0x2f, 0x16);
            this.CmdSave.Size = size;
            this.CmdSave.Text = "&Lưu";
            this.CmdUnsave.Image = (Image) manager.GetObject("CmdUnsave.Image");
            this.CmdUnsave.ImageTransparentColor = Color.White;
            this.CmdUnsave.Name = "CmdUnsave";
            size = new Size(0x39, 0x16);
            this.CmdUnsave.Size = size;
            this.CmdUnsave.Text = "&K.Lưu";
            point = new Point(200, 9);
            this.CmdSearchPhieuNhap.Location = point;
            this.CmdSearchPhieuNhap.Name = "CmdSearchPhieuNhap";
            size = new Size(0x18, 0x16);
            this.CmdSearchPhieuNhap.Size = size;
            this.CmdSearchPhieuNhap.TabIndex = 1;
            this.CmdSearchPhieuNhap.Text = "...";
            this.CmdSearchPhieuNhap.UseVisualStyleBackColor = true;
            this.Label4.AutoSize = true;
            this.Label4.BackColor = Color.Transparent;
            point = new Point(0xfd, 13);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            size = new Size(0x20, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 0x63;
            this.Label4.Text = "Ng\x00e0y";
            this.TxtNgayChungTuNhap.Enabled = false;
            this.TxtNgayChungTuNhap.Format = DateTimePickerFormat.Custom;
            point = new Point(0x132, 10);
            this.TxtNgayChungTuNhap.Location = point;
            this.TxtNgayChungTuNhap.Name = "TxtNgayChungTuNhap";
            size = new Size(0x63, 20);
            this.TxtNgayChungTuNhap.Size = size;
            this.TxtNgayChungTuNhap.TabIndex = 2;
            this.Label20.AutoSize = true;
            this.Label20.BackColor = Color.Transparent;
            point = new Point(0x17, 110);
            this.Label20.Location = point;
            this.Label20.Name = "Label20";
            size = new Size(0x4f, 13);
            this.Label20.Size = size;
            this.Label20.TabIndex = 0x72;
            this.Label20.Text = "T\x00e0i khoản thuế";
            this.Label16.AutoEllipsis = true;
            this.Label16.AutoSize = true;
            this.Label16.BackColor = Color.Transparent;
            point = new Point(0x17, 0x3d);
            this.Label16.Location = point;
            this.Label16.Name = "Label16";
            this.Label16.RightToLeft = RightToLeft.No;
            size = new Size(0x4b, 13);
            this.Label16.Size = size;
            this.Label16.TabIndex = 0x70;
            this.Label16.Text = "Nh\x00e0 cung cấp";
            this.Label16.TextAlign = ContentAlignment.TopRight;
            this.Label6.AutoSize = true;
            this.Label6.BackColor = Color.Transparent;
            point = new Point(0x17, 13);
            this.Label6.Location = point;
            this.Label6.Name = "Label6";
            size = new Size(0x44, 13);
            this.Label6.Size = size;
            this.Label6.TabIndex = 0x61;
            this.Label6.Text = "Đơn h\x00e0ng số";
            point = new Point(0x73, 10);
            this.TxtSoChungTuNhap.Location = point;
            this.TxtSoChungTuNhap.Name = "TxtSoChungTuNhap";
            this.TxtSoChungTuNhap.ReadOnly = true;
            size = new Size(0x55, 20);
            this.TxtSoChungTuNhap.Size = size;
            this.TxtSoChungTuNhap.TabIndex = 0;
            point = new Point(0x74, 0xb5);
            this.TxtDienGiai.Location = point;
            this.TxtDienGiai.Name = "TxtDienGiai";
            size = new Size(0x2ea, 20);
            this.TxtDienGiai.Size = size;
            this.TxtDienGiai.TabIndex = 0x10;
            this.Label9.AutoEllipsis = true;
            this.Label9.AutoSize = true;
            this.Label9.BackColor = Color.Transparent;
            point = new Point(0x18, 0xb8);
            this.Label9.Location = point;
            this.Label9.Name = "Label9";
            this.Label9.RightToLeft = RightToLeft.No;
            size = new Size(0x30, 13);
            this.Label9.Size = size;
            this.Label9.TabIndex = 0x5f;
            this.Label9.Text = "Diễn giải";
            this.Label9.TextAlign = ContentAlignment.TopRight;
            this.CboLoaiTien.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiTien.FormattingEnabled = true;
            point = new Point(0x75, 0x84);
            this.CboLoaiTien.Location = point;
            this.CboLoaiTien.Name = "CboLoaiTien";
            size = new Size(0x6c, 0x15);
            this.CboLoaiTien.Size = size;
            this.CboLoaiTien.TabIndex = 14;
            this.txtTyGia.BorderStyle = BorderStyle.FixedSingle;
            this.txtTyGia.DataType = typeof(double);
            this.txtTyGia.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x133, 0x85);
            this.txtTyGia.Location = point;
            this.txtTyGia.Name = "txtTyGia";
            size = new Size(0x63, 0x12);
            this.txtTyGia.Size = size;
            this.txtTyGia.TabIndex = 15;
            this.txtTyGia.Tag = null;
            this.txtTyGia.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this.Label11.AutoSize = true;
            this.Label11.BackColor = Color.Transparent;
            point = new Point(0x19, 0x87);
            this.Label11.Location = point;
            this.Label11.Name = "Label11";
            size = new Size(0x2f, 13);
            this.Label11.Size = size;
            this.Label11.TabIndex = 0x39;
            this.Label11.Text = "Loại tiền";
            this.Label11.TextAlign = ContentAlignment.TopRight;
            this.Label10.AutoSize = true;
            this.Label10.BackColor = Color.Transparent;
            point = new Point(0xfe, 0x87);
            this.Label10.Location = point;
            this.Label10.Name = "Label10";
            size = new Size(0x24, 13);
            this.Label10.Size = size;
            this.Label10.TabIndex = 0x38;
            this.Label10.Text = "Tỷ gi\x00e1";
            this.Label10.TextAlign = ContentAlignment.TopRight;
            this.Label2.AutoSize = true;
            this.Label2.BackColor = Color.Transparent;
            point = new Point(0x18, 0x55);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(70, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x25;
            this.Label2.Text = "T\x00e0i khoản nợ";
            this.Label13.AutoSize = true;
            this.Label13.BackColor = Color.Transparent;
            point = new Point(0xfd, 0x24);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x20, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 0x23;
            this.Label13.Text = "Ng\x00e0y";
            this.TxtNgayChungTu.Format = DateTimePickerFormat.Custom;
            point = new Point(0x132, 0x21);
            this.TxtNgayChungTu.Location = point;
            this.TxtNgayChungTu.Name = "TxtNgayChungTu";
            size = new Size(0x63, 20);
            this.TxtNgayChungTu.Size = size;
            this.TxtNgayChungTu.TabIndex = 4;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            point = new Point(0x17, 0x24);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x41, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x21;
            this.Label1.Text = "Số chứng từ";
            point = new Point(0x73, 0x21);
            this.TxtSoChungTu.Location = point;
            this.TxtSoChungTu.Name = "TxtSoChungTu";
            size = new Size(0x6c, 20);
            this.TxtSoChungTu.Size = size;
            this.TxtSoChungTu.TabIndex = 3;
            this.ToolStrip1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgbluenoborder;
            this.ToolStrip1.Items.AddRange(new ToolStripItem[] { this.CmdAdd, this.CmdEdit, this.ToolStripSeparator2, this.CmdSave, this.CmdUnsave, this.ToolStripSeparator1, this.CmdFind, this.CmdPrint, this.ToolStripButton1, this.CmdDel, this.ToolStripSeparator3, this.CmdExit, this.ToolStripButton2, this.CmdGhiSo, this.CmdBoGhiSo });
            point = new Point(0, 0);
            this.ToolStrip1.Location = point;
            this.ToolStrip1.Name = "ToolStrip1";
            size = new Size(0x37d, 0x19);
            this.ToolStrip1.Size = size;
            this.ToolStrip1.TabIndex = 0;
            this.ToolStrip1.Text = "ToolStrip1";
            this.CmdPrint.DropDownItems.AddRange(new ToolStripItem[] { this.InPhieuTraHangToolStripMenuItem, this.InToolStripMenuItem });
            this.CmdPrint.Image = (Image) manager.GetObject("CmdPrint.Image");
            this.CmdPrint.ImageTransparentColor = Color.White;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(0x2e, 0x16);
            this.CmdPrint.Size = size;
            this.CmdPrint.Text = "&In";
            this.InPhieuTraHangToolStripMenuItem.Name = "InPhieuTraHangToolStripMenuItem";
            size = new Size(0xa4, 0x16);
            this.InPhieuTraHangToolStripMenuItem.Size = size;
            this.InPhieuTraHangToolStripMenuItem.Text = "In phiếu trả h\x00e0ng";
            this.InToolStripMenuItem.Name = "InToolStripMenuItem";
            size = new Size(0xa4, 0x16);
            this.InToolStripMenuItem.Size = size;
            this.InToolStripMenuItem.Text = "In h\x00f3a đơn tự in";
            this.CmdGhiSo.Image = (Image) manager.GetObject("CmdGhiSo.Image");
            this.CmdGhiSo.ImageTransparentColor = Color.White;
            this.CmdGhiSo.Name = "CmdGhiSo";
            size = new Size(60, 0x16);
            this.CmdGhiSo.Size = size;
            this.CmdGhiSo.Text = "Ghi sổ";
            this.CmdGhiSo.Visible = false;
            this.CmdBoGhiSo.Image = (Image) manager.GetObject("CmdBoGhiSo.Image");
            this.CmdBoGhiSo.ImageTransparentColor = Color.Magenta;
            this.CmdBoGhiSo.Name = "CmdBoGhiSo";
            size = new Size(0x54, 0x16);
            this.CmdBoGhiSo.Size = size;
            this.CmdBoGhiSo.Text = "Huỷ ghi sổ";
            this.CmdBoGhiSo.Visible = false;
            this.CmdTimPhieuNhap.Items.AddRange(new ToolStripItem[] { this.CmdTimNhapKho, this.CmdTimNhapKhau });
            this.CmdTimPhieuNhap.Name = "ContextMenuStrip1";
            size = new Size(0xc1, 0x30);
            this.CmdTimPhieuNhap.Size = size;
            this.CmdTimNhapKho.Name = "CmdTimNhapKho";
            size = new Size(0xc0, 0x16);
            this.CmdTimNhapKho.Size = size;
            this.CmdTimNhapKho.Text = "H\x00e0ng mua trong nước";
            this.CmdTimNhapKhau.Name = "CmdTimNhapKhau";
            size = new Size(0xc0, 0x16);
            this.CmdTimNhapKhau.Size = size;
            this.CmdTimNhapKhau.Text = "H\x00e0ng nhập khẩu";
            this.TabDetails.Controls.Add(this.C1DockingTabPage2);
            this.TabDetails.Dock = DockStyle.Fill;
            point = new Point(0, 0x109);
            this.TabDetails.Location = point;
            this.TabDetails.Name = "TabDetails";
            this.TabDetails.SelectedIndex = 1;
            size = new Size(0x37d, 0xe2);
            this.TabDetails.Size = size;
            this.TabDetails.TabIndex = 2;
            this.TabDetails.TabsSpacing = 5;
            this.TabDetails.TabStyle = TabStyleEnum.Office2007;
            this.TabDetails.VisualStyle = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.TabDetails.VisualStyleBase = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTabPage2.Controls.Add(this.VSlist);
            point = new Point(1, 0x18);
            this.C1DockingTabPage2.Location = point;
            this.C1DockingTabPage2.Name = "C1DockingTabPage2";
            size = new Size(0x37b, 0xc9);
            this.C1DockingTabPage2.Size = size;
            this.C1DockingTabPage2.TabIndex = 0;
            this.C1DockingTabPage2.Text = "Chi tiết h\x00e0ng h\x00f3a";
            this.VSlist.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.XpThemes;
            this.VSlist.ColumnInfo = manager.GetString("VSlist.ColumnInfo");
            this.VSlist.Dock = DockStyle.Fill;
            this.VSlist.ExtendLastCol = true;
            this.VSlist.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(0, 0);
            this.VSlist.Location = point;
            Padding padding = new Padding(0);
            this.VSlist.Margin = padding;
            this.VSlist.Name = "VSlist";
            this.VSlist.Rows.Count = 1;
            this.VSlist.Rows.DefaultSize = 0x11;
            size = new Size(0x37b, 0xc9);
            this.VSlist.Size = size;
            this.VSlist.StyleInfo = manager.GetString("VSlist.StyleInfo");
            this.VSlist.TabIndex = 0;
            this.C1DockingTab1.Controls.Add(this.C1DockingTabPage1);
            this.C1DockingTab1.Dock = DockStyle.Top;
            point = new Point(0, 0x19);
            this.C1DockingTab1.Location = point;
            this.C1DockingTab1.Name = "C1DockingTab1";
            this.C1DockingTab1.SelectedIndex = 1;
            size = new Size(0x37d, 240);
            this.C1DockingTab1.Size = size;
            this.C1DockingTab1.TabIndex = 1;
            this.C1DockingTab1.TabsSpacing = 5;
            this.C1DockingTab1.TabStyle = TabStyleEnum.Office2007;
            this.C1DockingTab1.VisualStyle = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTab1.VisualStyleBase = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTabPage1.Controls.Add(this.Label19);
            this.C1DockingTabPage1.Controls.Add(this.txtHinhThucThanhToan);
            this.C1DockingTabPage1.Controls.Add(this.Label18);
            this.C1DockingTabPage1.Controls.Add(this.TxtThueSuat);
            this.C1DockingTabPage1.Controls.Add(this.TxtDiaChiThue);
            this.C1DockingTabPage1.Controls.Add(this.GrpHoaDon);
            this.C1DockingTabPage1.Controls.Add(this.Label7);
            this.C1DockingTabPage1.Controls.Add(this.Label16);
            this.C1DockingTabPage1.Controls.Add(this.Label11);
            this.C1DockingTabPage1.Controls.Add(this.CboLoaiHoaDon);
            this.C1DockingTabPage1.Controls.Add(this.AdvTaiKhoanThue);
            this.C1DockingTabPage1.Controls.Add(this.Label10);
            this.C1DockingTabPage1.Controls.Add(this.Label20);
            this.C1DockingTabPage1.Controls.Add(this.txtTyGia);
            this.C1DockingTabPage1.Controls.Add(this.Label2);
            this.C1DockingTabPage1.Controls.Add(this.CboLoaiTien);
            this.C1DockingTabPage1.Controls.Add(this.AdvNhaCungCap);
            this.C1DockingTabPage1.Controls.Add(this.AdvTaiKhoanNo);
            this.C1DockingTabPage1.Controls.Add(this.Label9);
            this.C1DockingTabPage1.Controls.Add(this.CmdSearchPhieuNhap);
            this.C1DockingTabPage1.Controls.Add(this.Label13);
            this.C1DockingTabPage1.Controls.Add(this.TxtDienGiai);
            this.C1DockingTabPage1.Controls.Add(this.Label4);
            this.C1DockingTabPage1.Controls.Add(this.TxtNgayChungTu);
            this.C1DockingTabPage1.Controls.Add(this.TxtSoChungTuNhap);
            this.C1DockingTabPage1.Controls.Add(this.Label1);
            this.C1DockingTabPage1.Controls.Add(this.TxtNgayChungTuNhap);
            this.C1DockingTabPage1.Controls.Add(this.Label6);
            this.C1DockingTabPage1.Controls.Add(this.TxtSoChungTu);
            point = new Point(1, 0x18);
            this.C1DockingTabPage1.Location = point;
            this.C1DockingTabPage1.Name = "C1DockingTabPage1";
            size = new Size(0x37b, 0xd7);
            this.C1DockingTabPage1.Size = size;
            this.C1DockingTabPage1.TabIndex = 0;
            this.C1DockingTabPage1.Text = "Th\x00f4ng tin trả h\x00e0ng";
            this.Label19.AutoEllipsis = true;
            this.Label19.AutoSize = true;
            this.Label19.BackColor = Color.Transparent;
            point = new Point(0x19, 160);
            this.Label19.Location = point;
            this.Label19.Name = "Label19";
            this.Label19.RightToLeft = RightToLeft.No;
            size = new Size(70, 13);
            this.Label19.Size = size;
            this.Label19.TabIndex = 0x92;
            this.Label19.Text = "Hinh thức TT";
            this.Label19.TextAlign = ContentAlignment.TopRight;
            point = new Point(0x75, 0x9d);
            this.txtHinhThucThanhToan.Location = point;
            this.txtHinhThucThanhToan.Name = "txtHinhThucThanhToan";
            size = new Size(0x121, 20);
            this.txtHinhThucThanhToan.Size = size;
            this.txtHinhThucThanhToan.TabIndex = 0x91;
            this.Label18.AutoSize = true;
            this.Label18.BackColor = Color.Transparent;
            point = new Point(0x29f, 0x88);
            this.Label18.Location = point;
            this.Label18.Name = "Label18";
            size = new Size(0x37, 13);
            this.Label18.Size = size;
            this.Label18.TabIndex = 0x90;
            this.Label18.Text = "Thuế suất";
            this.Label18.TextAlign = ContentAlignment.TopRight;
            this.TxtThueSuat.BorderStyle = BorderStyle.FixedSingle;
            this.TxtThueSuat.DataType = typeof(short);
            this.TxtThueSuat.FormatType = FormatTypeEnum.Integer;
            point = new Point(0x2db, 0x85);
            this.TxtThueSuat.Location = point;
            this.TxtThueSuat.Name = "TxtThueSuat";
            padding = new Padding(1);
            this.TxtThueSuat.Padding = padding;
            this.TxtThueSuat.ReadOnly = true;
            size = new Size(0x83, 20);
            this.TxtThueSuat.Size = size;
            this.TxtThueSuat.TabIndex = 0x8f;
            this.TxtThueSuat.Tag = null;
            this.TxtThueSuat.Value = (short) 0;
            this.TxtThueSuat.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtThueSuat.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtThueSuat.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            point = new Point(0x39b, 0x5b);
            this.TxtDiaChiThue.Location = point;
            this.TxtDiaChiThue.Name = "TxtDiaChiThue";
            size = new Size(170, 20);
            this.TxtDiaChiThue.Size = size;
            this.TxtDiaChiThue.TabIndex = 0x89;
            this.TxtDiaChiThue.Visible = false;
            this.GrpHoaDon.BackColor = Color.Transparent;
            this.GrpHoaDon.Controls.Add(this.CmdDTThue);
            this.GrpHoaDon.Controls.Add(this.TxtTenDoiTuongThue);
            this.GrpHoaDon.Controls.Add(this.Label17);
            this.GrpHoaDon.Controls.Add(this.Label8);
            this.GrpHoaDon.Controls.Add(this.Label14);
            this.GrpHoaDon.Controls.Add(this.txtMST);
            this.GrpHoaDon.Controls.Add(this.Label3);
            this.GrpHoaDon.Controls.Add(this.Label12);
            this.GrpHoaDon.Controls.Add(this.TxtNgayHoaDon);
            this.GrpHoaDon.Controls.Add(this.TxtSoSeri);
            this.GrpHoaDon.Controls.Add(this.txtMauHoaDon);
            this.GrpHoaDon.Controls.Add(this.TxtSoHoaDon);
            this.GrpHoaDon.Controls.Add(this.Label15);
            point = new Point(0x1a1, 10);
            this.GrpHoaDon.Location = point;
            this.GrpHoaDon.Name = "GrpHoaDon";
            size = new Size(0x1bd, 120);
            this.GrpHoaDon.Size = size;
            this.GrpHoaDon.TabIndex = 0x88;
            this.GrpHoaDon.TabStop = false;
            this.GrpHoaDon.Text = "Th\x00f4ng tin h\x00f3a đơn";
            this.CmdDTThue.BackgroundImageLayout = ImageLayout.Stretch;
            this.CmdDTThue.FlatStyle = FlatStyle.System;
            point = new Point(0x19d, 0x3e);
            this.CmdDTThue.Location = point;
            padding = new Padding(0);
            this.CmdDTThue.Margin = padding;
            this.CmdDTThue.Name = "CmdDTThue";
            size = new Size(0x17, 0x16);
            this.CmdDTThue.Size = size;
            this.CmdDTThue.TabIndex = 0x88;
            this.CmdDTThue.Text = "...";
            this.CmdDTThue.UseVisualStyleBackColor = true;
            point = new Point(0x69, 0x40);
            this.TxtTenDoiTuongThue.Location = point;
            this.TxtTenDoiTuongThue.Name = "TxtTenDoiTuongThue";
            this.TxtTenDoiTuongThue.ReadOnly = true;
            size = new Size(0x131, 20);
            this.TxtTenDoiTuongThue.Size = size;
            this.TxtTenDoiTuongThue.TabIndex = 0x87;
            this.Label17.AutoEllipsis = true;
            this.Label17.AutoSize = true;
            point = new Point(13, 0x44);
            this.Label17.Location = point;
            this.Label17.Name = "Label17";
            this.Label17.RightToLeft = RightToLeft.No;
            size = new Size(0x4d, 13);
            this.Label17.Size = size;
            this.Label17.TabIndex = 0x86;
            this.Label17.Text = "Đối tượng thuế";
            this.Label17.TextAlign = ContentAlignment.TopRight;
            this.Label8.AutoSize = true;
            this.Label8.BackColor = Color.Transparent;
            point = new Point(13, 0x13);
            this.Label8.Location = point;
            this.Label8.Name = "Label8";
            size = new Size(0x47, 13);
            this.Label8.Size = size;
            this.Label8.TabIndex = 0x7d;
            this.Label8.Text = "Mẫu h\x00f3a đơn";
            this.Label14.AutoSize = true;
            this.Label14.BackColor = Color.Transparent;
            point = new Point(0xf5, 0x13);
            this.Label14.Location = point;
            this.Label14.Name = "Label14";
            size = new Size(0x3f, 13);
            this.Label14.Size = size;
            this.Label14.TabIndex = 0x7d;
            this.Label14.Text = "Số h\x00f3a đơn";
            point = new Point(0x69, 0x57);
            this.txtMST.Location = point;
            this.txtMST.MaxLength = 14;
            this.txtMST.Name = "txtMST";
            this.txtMST.ReadOnly = true;
            size = new Size(0x148, 20);
            this.txtMST.Size = size;
            this.txtMST.TabIndex = 11;
            this.Label3.AutoSize = true;
            this.Label3.BackColor = Color.Transparent;
            point = new Point(13, 0x58);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(30, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x21;
            this.Label3.Text = "MST";
            this.Label12.AutoSize = true;
            this.Label12.BackColor = Color.Transparent;
            point = new Point(0xf5, 0x2c);
            this.Label12.Location = point;
            this.Label12.Name = "Label12";
            size = new Size(0x20, 13);
            this.Label12.Size = size;
            this.Label12.TabIndex = 0x85;
            this.Label12.Text = "Ng\x00e0y";
            this.TxtNgayHoaDon.Format = DateTimePickerFormat.Custom;
            point = new Point(0x13a, 0x27);
            this.TxtNgayHoaDon.Location = point;
            this.TxtNgayHoaDon.Name = "TxtNgayHoaDon";
            size = new Size(0x77, 20);
            this.TxtNgayHoaDon.Size = size;
            this.TxtNgayHoaDon.TabIndex = 10;
            point = new Point(0x69, 0x29);
            this.TxtSoSeri.Location = point;
            this.TxtSoSeri.Name = "TxtSoSeri";
            size = new Size(0x7a, 20);
            this.TxtSoSeri.Size = size;
            this.TxtSoSeri.TabIndex = 9;
            point = new Point(0x69, 0x10);
            this.txtMauHoaDon.Location = point;
            this.txtMauHoaDon.Name = "txtMauHoaDon";
            size = new Size(0x7a, 20);
            this.txtMauHoaDon.Size = size;
            this.txtMauHoaDon.TabIndex = 8;
            point = new Point(0x13a, 0x10);
            this.TxtSoHoaDon.Location = point;
            this.TxtSoHoaDon.Name = "TxtSoHoaDon";
            size = new Size(0x7a, 20);
            this.TxtSoHoaDon.Size = size;
            this.TxtSoHoaDon.TabIndex = 8;
            this.Label15.AutoSize = true;
            this.Label15.BackColor = Color.Transparent;
            point = new Point(13, 0x2c);
            this.Label15.Location = point;
            this.Label15.Name = "Label15";
            size = new Size(0x2a, 13);
            this.Label15.Size = size;
            this.Label15.TabIndex = 0x83;
            this.Label15.Text = "K\x00fd hiệu";
            this.Label7.AutoSize = true;
            this.Label7.BackColor = Color.Transparent;
            point = new Point(430, 0x87);
            this.Label7.Location = point;
            this.Label7.Name = "Label7";
            size = new Size(70, 13);
            this.Label7.Size = size;
            this.Label7.TabIndex = 0x87;
            this.Label7.Text = "Loại h\x00f3a đơn";
            this.Label7.TextAlign = ContentAlignment.TopRight;
            this.CboLoaiHoaDon.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiHoaDon.FormattingEnabled = true;
            point = new Point(0x20a, 0x84);
            this.CboLoaiHoaDon.Location = point;
            this.CboLoaiHoaDon.Name = "CboLoaiHoaDon";
            size = new Size(0x7a, 0x15);
            this.CboLoaiHoaDon.Size = size;
            this.CboLoaiHoaDon.TabIndex = 12;
            this.AdvTaiKhoanThue.Conditions = "";
            this.AdvTaiKhoanThue.DefaultValue = "";
            this.AdvTaiKhoanThue.FieldNameFilter = "Left(SoTaiKhoan,3)";
            this.AdvTaiKhoanThue.KeyFilter = "133|333";
            point = new Point(0x73, 0x6b);
            this.AdvTaiKhoanThue.Location = point;
            padding = new Padding(0);
            this.AdvTaiKhoanThue.Margin = padding;
            this.AdvTaiKhoanThue.Name = "AdvTaiKhoanThue";
            this.AdvTaiKhoanThue.OnlyDigit = false;
            this.AdvTaiKhoanThue.ReadOnly = false;
            size = new Size(290, 20);
            this.AdvTaiKhoanThue.Size = size;
            this.AdvTaiKhoanThue.TabIndex = 13;
            this.AdvTaiKhoanThue.UpperText = true;
            this.AdvTaiKhoanThue.Value = "";
            this.AdvTaiKhoanThue.WithCode = 80;
            this.AdvNhaCungCap.Conditions = "";
            this.AdvNhaCungCap.LoaiDoiTuong = modGeneral.TypeObjects.NhaCungCap;
            point = new Point(0x73, 0x3a);
            this.AdvNhaCungCap.Location = point;
            this.AdvNhaCungCap.Name = "AdvNhaCungCap";
            this.AdvNhaCungCap.ReadOnly = false;
            size = new Size(290, 20);
            this.AdvNhaCungCap.Size = size;
            this.AdvNhaCungCap.TabIndex = 5;
            this.AdvNhaCungCap.UpperText = true;
            this.AdvNhaCungCap.Value = "";
            this.AdvNhaCungCap.WidthCode = 80;
            this.AdvTaiKhoanNo.Conditions = "";
            this.AdvTaiKhoanNo.DefaultValue = "";
            this.AdvTaiKhoanNo.FieldNameFilter = "Left(SoTaiKhoan,3)";
            this.AdvTaiKhoanNo.KeyFilter = "111|112|331";
            point = new Point(0x74, 0x51);
            this.AdvTaiKhoanNo.Location = point;
            padding = new Padding(0);
            this.AdvTaiKhoanNo.Margin = padding;
            this.AdvTaiKhoanNo.Name = "AdvTaiKhoanNo";
            this.AdvTaiKhoanNo.OnlyDigit = false;
            this.AdvTaiKhoanNo.ReadOnly = false;
            size = new Size(290, 20);
            this.AdvTaiKhoanNo.Size = size;
            this.AdvTaiKhoanNo.TabIndex = 6;
            this.AdvTaiKhoanNo.UpperText = true;
            this.AdvTaiKhoanNo.Value = "";
            this.AdvTaiKhoanNo.WithCode = 80;
            this.C1DockingTab2.Controls.Add(this.C1DockingTabPage3);
            this.C1DockingTab2.Dock = DockStyle.Bottom;
            point = new Point(0, 0x1eb);
            this.C1DockingTab2.Location = point;
            this.C1DockingTab2.Name = "C1DockingTab2";
            size = new Size(0x37d, 0x73);
            this.C1DockingTab2.Size = size;
            this.C1DockingTab2.TabIndex = 2;
            this.C1DockingTab2.TabsSpacing = 5;
            this.C1DockingTab2.TabStyle = TabStyleEnum.Office2007;
            this.C1DockingTab2.VisualStyle = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTab2.VisualStyleBase = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTabPage3.Controls.Add(this.TxtTongThanhToanNT);
            this.C1DockingTabPage3.Controls.Add(this.CmdDelRow);
            this.C1DockingTabPage3.Controls.Add(this.TxtTongThanhToan);
            this.C1DockingTabPage3.Controls.Add(this.CmdAddRow);
            this.C1DockingTabPage3.Controls.Add(this.Label23);
            this.C1DockingTabPage3.Controls.Add(this.TxtTienHang);
            this.C1DockingTabPage3.Controls.Add(this.Label5);
            this.C1DockingTabPage3.Controls.Add(this.TxtTienThueNT);
            this.C1DockingTabPage3.Controls.Add(this.Label21);
            this.C1DockingTabPage3.Controls.Add(this.Label22);
            this.C1DockingTabPage3.Controls.Add(this.TxtTienHangNT);
            this.C1DockingTabPage3.Controls.Add(this.TxtChietKhau);
            this.C1DockingTabPage3.Controls.Add(this.TxtTienThue);
            this.C1DockingTabPage3.Controls.Add(this.TxtChietKhauNT);
            point = new Point(1, 10);
            this.C1DockingTabPage3.Location = point;
            this.C1DockingTabPage3.Name = "C1DockingTabPage3";
            size = new Size(0x37b, 0x68);
            this.C1DockingTabPage3.Size = size;
            this.C1DockingTabPage3.TabIndex = 0;
            this.CboLoaiIn.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiIn.FormattingEnabled = true;
            point = new Point(0x5d, 1);
            this.CboLoaiIn.Location = point;
            this.CboLoaiIn.Name = "CboLoaiIn";
            size = new Size(0x85, 0x15);
            this.CboLoaiIn.Size = size;
            this.CboLoaiIn.TabIndex = 40;
            this.Label35.AutoSize = true;
            this.Label35.BackColor = Color.Transparent;
            point = new Point(6, 5);
            this.Label35.Location = point;
            this.Label35.Name = "Label35";
            size = new Size(0x51, 13);
            this.Label35.Size = size;
            this.Label35.TabIndex = 0x29;
            this.Label35.Text = "Loại in h\x00f3a đơn";
            this.Panel1.BackColor = Color.Khaki;
            this.Panel1.Controls.Add(this.CboLoaiIn);
            this.Panel1.Controls.Add(this.Label35);
            point = new Point(0x297, 0x19);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            size = new Size(0xe5, 0x18);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0x92;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x37d, 0x25e);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.Panel1);
            this.Controls.Add(this.TabDetails);
            this.Controls.Add(this.C1DockingTab1);
            this.Controls.Add(this.C1DockingTab2);
            this.Controls.Add(this.ToolStrip1);
            this.Name = "Frm_TraHangNhaCungCap";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "MH-0004                   ";
            this.Text = "TRA HANG NHA CUNG CAP";
            ((ISupportInitialize) this.TxtTienHangNT).EndInit();
            ((ISupportInitialize) this.TxtChietKhauNT).EndInit();
            ((ISupportInitialize) this.TxtTienThue).EndInit();
            ((ISupportInitialize) this.TxtTienHang).EndInit();
            ((ISupportInitialize) this.TxtChietKhau).EndInit();
            ((ISupportInitialize) this.TxtTongThanhToanNT).EndInit();
            ((ISupportInitialize) this.TxtTongThanhToan).EndInit();
            ((ISupportInitialize) this.TxtTienThueNT).EndInit();
            ((ISupportInitialize) this.txtTyGia).EndInit();
            this.ToolStrip1.ResumeLayout(false);
            this.ToolStrip1.PerformLayout();
            this.CmdTimPhieuNhap.ResumeLayout(false);
            ((ISupportInitialize) this.TabDetails).EndInit();
            this.TabDetails.ResumeLayout(false);
            this.C1DockingTabPage2.ResumeLayout(false);
            this.VSlist.EndInit();
            ((ISupportInitialize) this.C1DockingTab1).EndInit();
            this.C1DockingTab1.ResumeLayout(false);
            this.C1DockingTabPage1.ResumeLayout(false);
            this.C1DockingTabPage1.PerformLayout();
            ((ISupportInitialize) this.TxtThueSuat).EndInit();
            this.GrpHoaDon.ResumeLayout(false);
            this.GrpHoaDon.PerformLayout();
            ((ISupportInitialize) this.C1DockingTab2).EndInit();
            this.C1DockingTab2.ResumeLayout(false);
            this.C1DockingTabPage3.ResumeLayout(false);
            this.C1DockingTabPage3.PerformLayout();
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        private void InPhieuTraHangToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.ToString().Trim() != "")
            {
                ReportModule.PrintHoaDon(this.cFrmKhoa);
            }
        }

        public void InsertDetails(string pKhoa)
        {
            int num = 0;
            clsNhapKhoChiTiet tiet = new clsNhapKhoChiTiet();
            if (!this.SearchDetail(pKhoa))
            {
                DataTable table = tiet.LoadDetails(pKhoa);
                if (table != null)
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                    vSlist.AddItem("");
                    int num2 = vSlist.Cols.Count - 2;
                    for (num = 1; num <= num2; num++)
                    {
                        vSlist[vSlist.Rows.Count - 1, num] = RuntimeHelpers.GetObjectValue(table.Rows[0][num]);
                    }
                    vSlist[vSlist.Rows.Count - 1, 0x1a] = RuntimeHelpers.GetObjectValue(table.Rows[0][0]);
                    vSlist[vSlist.Rows.Count - 1, 13] = Microsoft.VisualBasic.CompilerServices.Operators.SubtractObject(table.Rows[0]["SoLuong"], table.Rows[0]["SoLuongDaTra"]);
                    this.objHH.LoadTonKho(Conversions.ToString(vSlist[vSlist.Rows.Count - 1, 3]), Conversions.ToString(vSlist[vSlist.Rows.Count - 1, 1]), "", Conversions.ToString(vSlist[vSlist.Rows.Count - 1, 6]), Conversions.ToString(vSlist[vSlist.Rows.Count - 1, 8]), Conversions.ToString(vSlist[vSlist.Rows.Count - 1, 9]), Conversions.ToString(vSlist[vSlist.Rows.Count - 1, 7]), LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6));
                    if (this.objHH.SoLuongTonKho != 0.0)
                    {
                        if (this.objHH.SoLuongTonKho > Conversions.ToDouble(vSlist[vSlist.Rows.Count - 1, 13]))
                        {
                            vSlist[vSlist.Rows.Count - 1, 0x10] = Conversions.ToDouble(vSlist[vSlist.Rows.Count - 1, 14]);
                            vSlist[vSlist.Rows.Count - 1, 0x11] = Conversions.ToDouble(vSlist[vSlist.Rows.Count - 1, 14]) * Conversions.ToDouble(vSlist[vSlist.Rows.Count - 1, 0x10]);
                        }
                        else
                        {
                            vSlist[vSlist.Rows.Count - 1, 0x10] = Math.Round((double) (this.objHH.TriGiaTonKho / this.objHH.SoLuongTonKho), 0);
                            vSlist[vSlist.Rows.Count - 1, 0x11] = Math.Round((double) (this.objHH.TriGiaTonKho / this.objHH.SoLuongTonKho), 0) * Conversions.ToDouble(vSlist[vSlist.Rows.Count - 1, 13]);
                        }
                    }
                    this.objNK.Load(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoChungTuNhap.Tag), "", modGeneral.TypeOfValue.Nothing).ToString().Trim());
                    if (this.objNK.NguonNhap == "NK")
                    {
                        vSlist[vSlist.Rows.Count - 1, 0x15] = 0;
                    }
                    vSlist = null;
                    this.TinhTong();
                }
            }
        }

        public void InsertPhieuNhap(string strKhoa)
        {
            clsNhapKho kho = new clsNhapKho();
            kho.Load(strKhoa);
            this.TxtSoChungTuNhap.Tag = kho.Khoa;
            this.TxtSoChungTuNhap.Text = kho.SoChungTu;
            this.AdvNhaCungCap.Value = kho.KhoaDoiTuong;
            this.TxtNgayChungTuNhap.Text = LVYModule.Char2Date(kho.NgayChungTu);
            this.AdvTaiKhoanNo.Value = kho.KhoaTKThanhToan;
            this.AdvTaiKhoanThue.Value = kho.KhoaTKNoThueVAT;
            this.CboLoaiTien.SelectedValue = kho.LoaiTien;
            this.CboLoaiTien.Enabled = false;
            this.AdvNhaCungCap.ReadOnly = true;
        }

        private void InToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.ToString().Trim() != "")
            {
                if (this.CboLoaiIn.SelectedValue.ToString().Trim() == "TI")
                {
                    MyProject.Forms.Frm_InHoaDonTuIn.Dispose();
                    MyProject.Forms.Frm_InHoaDonTuIn.cFrmLoaiBanHang = "TH";
                    MyProject.Forms.Frm_InHoaDonTuIn.cFrmKhoa = this.cFrmKhoa;
                    MyProject.Forms.Frm_InHoaDonTuIn.objFrmCall = this;
                    MyProject.Forms.Frm_InHoaDonTuIn.ShowDialog();
                }
                if (this.CboLoaiIn.SelectedValue.ToString().Trim() == "DI")
                {
                }
            }
        }

        private void Label14_Click(object sender, EventArgs e)
        {
        }

        public void LoadDetailsHangHoa(string pKhoa)
        {
            DataTable detailsTraHang = this.objTH.GetDetailsTraHang(pKhoa);
            if (detailsTraHang != null)
            {
                this.VSlist.Select(0, 0);
                this.VSlist.Rows.Count = 1;
                int num2 = detailsTraHang.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                    vSlist.AddItem("");
                    vSlist[vSlist.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["Khoa"]);
                    vSlist[vSlist.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["KhoaKho"]);
                    vSlist[vSlist.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["KhoHang"]);
                    vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["KhoaHangHoa"]);
                    vSlist[vSlist.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["Ma"]);
                    vSlist[vSlist.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["HangHoa"]);
                    vSlist[vSlist.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["SoLoHang"]);
                    vSlist[vSlist.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["SoSeri"]);
                    vSlist[vSlist.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["NgayNhap"]);
                    vSlist[vSlist.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["HanSuDung"]);
                    vSlist[vSlist.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["KhoaDonViTinh"]);
                    vSlist[vSlist.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["DonViTinh"]);
                    vSlist[vSlist.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["QuyCach"]);
                    vSlist[vSlist.Rows.Count - 1, 13] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["SoLuong"]);
                    vSlist[vSlist.Rows.Count - 1, 0x10] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["GiaBanNT"]);
                    vSlist[vSlist.Rows.Count - 1, 0x11] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["TienBanNT"]);
                    vSlist[vSlist.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["GiaBanNT"]);
                    vSlist[vSlist.Rows.Count - 1, 15] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["TienBanNT"]);
                    vSlist[vSlist.Rows.Count - 1, 0x12] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["TyLeChietKhau"]);
                    vSlist[vSlist.Rows.Count - 1, 0x13] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["TienChietKhauNT"]);
                    vSlist[vSlist.Rows.Count - 1, 20] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["TyLeThue"]);
                    vSlist[vSlist.Rows.Count - 1, 0x15] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["TienThueNT"]);
                    vSlist[vSlist.Rows.Count - 1, 0x16] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["KhoaTKHangHoa"]);
                    vSlist[vSlist.Rows.Count - 1, 0x17] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["TaiKhoanHangHoa"]);
                    vSlist[vSlist.Rows.Count - 1, 0x18] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["KhoaTKGiaVon"]);
                    vSlist[vSlist.Rows.Count - 1, 0x19] = RuntimeHelpers.GetObjectValue(detailsTraHang.Rows[i]["TaiKhoanGiaVon"]);
                    vSlist = null;
                }
            }
        }

        private void Panel4_Paint(object sender, PaintEventArgs e)
        {
        }

        public bool SaveHHDetailsTemp()
        {
            double num2 = 0.0;
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            clsXuatKhoChiTiet objHDCT = this.objHDCT;
            int num3 = this.VSlist.Rows.Count - 1;
            for (int i = 1; i <= num3; i++)
            {
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                {
                    if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                    {
                        this.VSlist[i, 0] = modGeneral.CreatKey("ST_XuatKhoChiTiet", 15, "");
                    }
                    objHDCT.Khoa = this.VSlist[i, 0].ToString().Trim();
                    objHDCT.KhoaPhieuXuat = this.cFrmKhoa;
                    objHDCT.KhoaHangHoa = this.VSlist[i, 3].ToString().Trim();
                    objHDCT.NgayBan = LVYModule.Date2Char(this.TxtNgayChungTu.Text);
                    objHDCT.KhoaKho = this.VSlist[i, 1].ToString().Trim();
                    objHDCT.SoLoHang = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 6]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    objHDCT.HanSuDung = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 9]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    objHDCT.SoSeri = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 7]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    if ((objHDCT.SoLoHang.Trim() + objHDCT.HanSuDung.Trim() + objHDCT.SoSeri.Trim()) != "")
                    {
                        objHDCT.NgayNhap = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 8]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    }
                    else
                    {
                        objHDCT.NgayNhap = "";
                    }
                    objHDCT.SoLuong = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 13]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDCT.GiaBanNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 14]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDCT.GiaBan = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 14]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objHDCT.TienBanNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 15]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDCT.TienBan = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 15]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objHDCT.GiaVonNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0x10]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDCT.GiaVon = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0x10]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objHDCT.TienVonNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0x11]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDCT.TienVon = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0x11]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objHDCT.TyLeThue = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 20]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDCT.TienThueNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0x15]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDCT.TienThue = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0x15]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objHDCT.TyLeChietKhau = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0x12]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDCT.TienChietKhauNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0x13]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDCT.TienChietKhau = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0x13]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objHDCT.KhoaDonViTinh = this.VSlist[i, 10].ToString().Trim();
                    objHDCT.QuyCach = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 12]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDCT.KhoaTKHangHoa = this.VSlist[i, 0x16].ToString().Trim();
                    objHDCT.KhoaTKGiaVon = this.VSlist[i, 0x18].ToString().Trim();
                    if (!objHDCT.Save())
                    {
                        return false;
                    }
                }
            }
            objHDCT = null;
            return true;
        }

        public bool SearchDetail(string pKhoa)
        {
            int num2 = this.VSlist.Rows.Count - 1;
            for (int i = 1; i <= num2; i++)
            {
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == pKhoa.Trim())
                {
                    return true;
                }
            }
            return false;
        }

        public void SetLoaiHoaDon(int intThueSuat)
        {
            switch (intThueSuat)
            {
                case 5:
                    this.CboLoaiHoaDon.SelectedValue = "0000000005";
                    break;

                case 6:
                case 7:
                case 8:
                case 9:
                    break;

                case 10:
                    this.CboLoaiHoaDon.SelectedValue = "0000000006";
                    break;

                default:
                    break;
                    this.CboLoaiHoaDon.SelectedValue = "0000000007";
                    break;
            }
        }

        public void ShowData(string pKhoa)
        {
            if (this.objTH.Load(pKhoa))
            {
                if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(LVYModule.ReturnIfNull(this.objTH.DaIn, 0, modGeneral.TypeOfValue.Nothing), 1, false))
                {
                    this.CmdEdit.Enabled = false;
                    this.CmdDel.Enabled = false;
                }
                clsXuatKho objTH = this.objTH;
                this.cFrmKhoa = objTH.Khoa;
                this.TxtSoChungTuNhap.Tag = objTH.KhoaDonHang;
                this.TxtSoChungTuNhap.Text = objTH.SoDonHang;
                this.TxtNgayChungTuNhap.Text = LVYModule.Char2Date(objTH.NgayDonHang);
                this.TxtSoChungTu.Text = objTH.SoChungTu;
                this.TxtNgayChungTu.Text = LVYModule.Char2Date(objTH.NgayChungTu);
                this.AdvNhaCungCap.Value = objTH.KhoaDoiTuong;
                this.CboLoaiTien.SelectedValue = objTH.LoaiTien;
                this.txtTyGia.Value = objTH.TyGia;
                this.TxtTienHangNT.Value = objTH.TienHangNT;
                this.TxtTienHang.Value = objTH.TienHang;
                this.TxtChietKhauNT.Value = objTH.TienChietKhauNT;
                this.TxtChietKhau.Value = objTH.TienChietKhau;
                this.TxtTienThueNT.Value = objTH.TienThueVATNT;
                this.TxtTienThue.Value = objTH.TienThueVAT;
                this.TxtTongThanhToanNT.Value = (objTH.TienHangNT - objTH.TienChietKhauNT) + objTH.TienThueVATNT;
                this.TxtTongThanhToan.Value = (objTH.TienHang - objTH.TienChietKhau) + objTH.TienThueVAT;
                this.AdvTaiKhoanNo.Value = objTH.KhoaTKThanhToan;
                this.AdvTaiKhoanThue.Value = objTH.KhoaTKThue;
                this.TxtDienGiai.Text = objTH.DienGiai;
                this.cFrmGhiSo = objTH.GhiSo;
                this.txtMauHoaDon.Text = objTH.MauHoaDon;
                this.TxtSoHoaDon.Text = objTH.SoHoaDon;
                this.TxtSoSeri.Text = objTH.SoSeri;
                this.TxtNgayHoaDon.Text = LVYModule.Char2Date(objTH.NgayHoaDon);
                this.CboLoaiHoaDon.SelectedValue = RuntimeHelpers.GetObjectValue(LVYModule.ReturnIfNull(objTH.KhoaLoaiHoaDon, "", modGeneral.TypeOfValue.Nothing));
                this.TxtThueSuat.Value = RuntimeHelpers.GetObjectValue(LVYModule.ReturnIfNull(objTH.ThueSuat, 0, modGeneral.TypeOfValue.Nothing));
                this.txtMST.Text = objTH.MaSoThue;
                this.TxtTenDoiTuongThue.Text = objTH.TenDoiTuongThue.Trim();
                if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectNotEqual(LVYModule.ReturnIfNull(objTH.KhoaLoaiIn, "", modGeneral.TypeOfValue.Nothing), "", false))
                {
                    this.CboLoaiIn.SelectedValue = objTH.KhoaLoaiIn;
                }
                this.txtHinhThucThanhToan.Text = objTH.HinhThucThanhToan.Trim();
                this.LoadDetailsHangHoa(this.cFrmKhoa);
                objTH = null;
            }
        }

        public void TimHangTonKho(int nRow, int nCol)
        {
            bool wasLoad = true;
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing)) == 0.0)
            {
            }
            string khoaKho = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            if (khoaKho != "")
            {
                object instance = SearchModule.SearchGoodsInStock(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), khoaKho, modGeneral.H_GIACHUAN, wasLoad);
                if ((instance != null) && (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 1 }, null)), "", modGeneral.TypeOfValue.String).ToString().Trim() != ""))
                {
                    this.objHH.Load(Conversions.ToString(NewLateBinding.LateIndexGet(instance, new object[] { 1 }, null)));
                    this.pdt = this.objHH.GetHangHoa(Conversions.ToString(NewLateBinding.LateIndexGet(instance, new object[] { 1 }, null)));
                    this.objDVT.Load(this.objHH.KhoaDonViTinh);
                    C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                    vSlist[nRow, 3] = this.objHH.Khoa;
                    vSlist[nRow, 4] = this.objHH.Ma;
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        vSlist[nRow, 5] = this.objHH.TenViet;
                        vSlist[nRow, 11] = this.objDVT.TenViet;
                    }
                    else
                    {
                        vSlist[nRow, 5] = this.objHH.TenAnh;
                        vSlist[nRow, 11] = this.objDVT.TenAnh;
                    }
                    vSlist[nRow, 7] = NewLateBinding.LateIndexGet(instance, new object[] { 4 }, null).ToString().Trim();
                    vSlist[nRow, 8] = NewLateBinding.LateIndexGet(instance, new object[] { 3 }, null).ToString().Trim();
                    vSlist[nRow, 10] = this.objHH.KhoaDonViTinh;
                    vSlist[nRow, 12] = 1;
                    vSlist[nRow, 13] = 1;
                    vSlist[nRow, 0x10] = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 7 }, null)), 0, modGeneral.TypeOfValue.Nothing));
                    vSlist[nRow, 0x11] = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 7 }, null)), 0, modGeneral.TypeOfValue.Nothing));
                    vSlist[nRow, 20] = RuntimeHelpers.GetObjectValue(this.TxtThueSuat.Value);
                    vSlist[nRow, 0x16] = RuntimeHelpers.GetObjectValue(this.pdt.Rows[0]["KhoaTKHangHoa"]);
                    vSlist[nRow, 0x17] = RuntimeHelpers.GetObjectValue(this.pdt.Rows[0]["TaiKhoanHangHoa"]);
                    vSlist[nRow, 0x18] = RuntimeHelpers.GetObjectValue(this.pdt.Rows[0]["KhoaTKGiaVon"]);
                    vSlist[nRow, 0x19] = RuntimeHelpers.GetObjectValue(this.pdt.Rows[0]["TaiKhoanGiaVon"]);
                    vSlist.Select(nRow, 13);
                    vSlist = null;
                }
            }
        }

        public void TinhChietKhau(int nRow)
        {
            double num = 0.0;
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 15]), 0, modGeneral.TypeOfValue.Nothing));
            int num2 = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 0x12]), 0, modGeneral.TypeOfValue.Nothing));
            this.VSlist[nRow, 0x13] = Math.Round((double) ((num * num2) / 100.0), 0);
        }

        private void TinhThue(int nRow)
        {
            double num = 0.0;
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            int num2 = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[nRow, 20]), 0, modGeneral.TypeOfValue.Nothing));
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[nRow, 15]), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[nRow, 0x13]), 0, modGeneral.TypeOfValue.Nothing));
            vSlist[nRow, 0x15] = Math.Round((double) ((num2 * num) / 100.0), 0);
            vSlist = null;
        }

        public void TinhTienBan(int nRow)
        {
            double num = 0.0;
            double num2 = 0.0;
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[nRow, 14]), 0, modGeneral.TypeOfValue.Nothing));
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[nRow, 13]), 0, modGeneral.TypeOfValue.Nothing));
            vSlist[nRow, 15] = num * num2;
            vSlist = null;
        }

        public void TinhTienVon(int nRow)
        {
            double num = 0.0;
            double num3 = 0.0;
            double num2 = 0.0;
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[nRow, 0x10]), 0, modGeneral.TypeOfValue.Nothing));
            num3 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[nRow, 13]), 0, modGeneral.TypeOfValue.Nothing));
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[nRow, 12]), 1, modGeneral.TypeOfValue.Nothing));
            vSlist[nRow, 0x11] = (num * num3) * num2;
            vSlist = null;
        }

        public void TinhTong()
        {
            double num = 0.0;
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtTienHangNT.Value = LVYModule.SumColGrid(this.VSlist, 15);
            this.TxtChietKhauNT.Value = LVYModule.SumColGrid(this.VSlist, 0x13);
            this.TxtTienThueNT.Value = LVYModule.SumColGrid(this.VSlist, 0x15);
            this.TxtTongThanhToanNT.Value = (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing))) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThueNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtTienHang.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num;
            this.TxtChietKhau.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num;
            this.TxtTienThue.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThueNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num;
            this.TxtTongThanhToan.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTongThanhToanNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num;
        }

        private void TxtThueSuat_ValueChanged(object sender, EventArgs e)
        {
            if (this.isLoaded)
            {
                int num2 = this.VSlist.Rows.Count - 1;
                for (int i = 1; i <= num2; i++)
                {
                    this.VSlist[i, 20] = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtThueSuat.Value), 0, modGeneral.TypeOfValue.Nothing));
                    RowColEventArgs args = new RowColEventArgs(i, 20);
                    this.VSList_AfterEdit(this.VSlist, args);
                }
                this.TinhTong();
            }
        }

        public object UpdateData()
        {
            object obj2;
            clsXuatKho objTH = this.objTH;
            objTH.Khoa = this.cFrmKhoa;
            objTH.KhoaDonHang = Conversions.ToString(this.TxtSoChungTuNhap.Tag);
            objTH.SoDonHang = this.TxtSoChungTuNhap.Text.ToString().Trim();
            objTH.NgayDonHang = LVYModule.Date2Char(this.TxtNgayChungTuNhap.Text.ToString().Trim());
            objTH.SoChungTu = this.TxtSoChungTu.Text.Trim();
            objTH.NgayChungTu = LVYModule.Date2Char(this.TxtNgayChungTu.Text);
            objTH.KhoaDoiTuong = this.AdvNhaCungCap.Value;
            objTH.NguoiGiao = "";
            objTH.KhoaBoPhan = "";
            objTH.KhoaSanPham = "";
            objTH.KhoaHopDong = "";
            objTH.LoaiTien = this.CboLoaiTien.SelectedValue.ToString().Trim();
            objTH.TyGia = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
            objTH.TienHangNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTH.TienHang = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHang.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTH.TienChietKhauNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTH.TienChietKhau = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhau.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTH.TienThueVATNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThueNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTH.TienThueVAT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThue.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTH.DaThanhToanNT = 0.0;
            objTH.DaThanhToan = 0.0;
            objTH.LoaiChungTu = "TH";
            objTH.KhoaNhanVienTao = modGeneral.H_USERID;
            objTH.NgayTao = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            objTH.KhoaNhanVienSua = modGeneral.H_USERID;
            objTH.NgaySua = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            if (this.CboLoaiIn.SelectedValue.ToString().Trim() == "DI")
            {
                objTH.GhiSo = 1;
            }
            else if (this.CboLoaiIn.SelectedValue.ToString().Trim() == "TI")
            {
                objTH.GhiSo = 0;
            }
            objTH.KhoaDonVi = modGeneral.H_CLIENT;
            objTH.Send = 0;
            objTH.DienGiai = this.TxtDienGiai.Text;
            objTH.KhoaTKThanhToan = this.AdvTaiKhoanNo.Value;
            objTH.KhoaTKThue = this.AdvTaiKhoanThue.Value;
            objTH.SoHoaDon = this.TxtSoHoaDon.Text.ToString().Trim();
            objTH.NgayHoaDon = LVYModule.Date2Char(this.TxtNgayHoaDon.Text.ToString().Trim());
            objTH.SoSeri = this.TxtSoSeri.Text.ToString().Trim();
            objTH.MaSoThue = this.txtMST.Text.Trim();
            objTH.KhoaLoaiHoaDon = Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiHoaDon.SelectedValue), "", modGeneral.TypeOfValue.Nothing));
            objTH.ThueSuat = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtThueSuat.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTH.TenDoiTuongThue = this.TxtTenDoiTuongThue.Text.Trim();
            objTH.MauHoaDon = this.txtMauHoaDon.Text.Trim();
            objTH.HinhThucThanhToan = this.txtHinhThucThanhToan.Text.Trim();
            return objTH.Save();
            objTH = null;
            return obj2;
        }

        private void VSList_AfterEdit(object sender, RowColEventArgs e)
        {
            switch (e.Col)
            {
                case 11:
                case 12:
                    this.TinhTienVon(e.Row);
                    this.TinhTienBan(e.Row);
                    this.TinhChietKhau(e.Row);
                    this.TinhThue(e.Row);
                    break;

                case 13:
                    if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoChungTuNhap.Tag), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                    {
                        string pKhoa = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, 0x1a]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                        clsNhapKhoChiTiet tiet = new clsNhapKhoChiTiet();
                        tiet.Load(pKhoa);
                        if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, 13]), 0, modGeneral.TypeOfValue.Nothing)) > (tiet.SoLuong - tiet.SoLuongDaTra))
                        {
                            LVYModule.ShowWarning(modGeneral.Tranlated("Số lượng trả lại phải nhỏ hơn hoặc bằng số lượng mua!", ""));
                            this.VSlist[e.Row, 13] = tiet.SoLuong - tiet.SoLuongDaTra;
                        }
                    }
                    this.TinhTienVon(e.Row);
                    this.TinhTienBan(e.Row);
                    this.TinhChietKhau(e.Row);
                    this.TinhThue(e.Row);
                    break;

                case 14:
                case 15:
                    this.TinhTienBan(e.Row);
                    this.TinhChietKhau(e.Row);
                    this.TinhThue(e.Row);
                    break;

                case 0x12:
                    this.TinhChietKhau(e.Row);
                    this.TinhThue(e.Row);
                    break;

                case 0x13:
                    this.TinhThue(e.Row);
                    break;

                case 20:
                    this.TinhThue(e.Row);
                    break;
            }
            this.TinhTong();
        }

        private void VSList_BeforeEdit(object sender, RowColEventArgs e)
        {
            if (!this.mEnabledControl)
            {
                e.Cancel = true;
            }
            else
            {
                switch (e.Col)
                {
                    case 5:
                    case 6:
                    case 7:
                    case 8:
                    case 9:
                        e.Cancel = true;
                        break;
                }
            }
        }

        private void VSList_CellButtonClick(object sender, RowColEventArgs e)
        {
            switch (e.Col)
            {
                case 2:
                {
                    string expression = SearchModule.SearchStore("");
                    if (expression.Trim() != "")
                    {
                        object instance = Strings.Split(expression, "|", -1, CompareMethod.Binary);
                        this.VSlist[e.Row, 1] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 0 }, null));
                        this.VSlist[e.Row, 2] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 2 }, null));
                    }
                    this.VSlist.Select(e.Row, 4);
                    break;
                }
                case 4:
                    this.TimHangTonKho(e.Row, e.Col);
                    break;
            }
        }

        internal virtual ADVObjects AdvNhaCungCap
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvNhaCungCap;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVObjects.ValueChangedEventHandler handler = new ADVObjects.ValueChangedEventHandler(this.AdvNhaCungCap_ValueChanged);
                if (this._AdvNhaCungCap != null)
                {
                    this._AdvNhaCungCap.ValueChanged -= handler;
                }
                this._AdvNhaCungCap = value;
                if (this._AdvNhaCungCap != null)
                {
                    this._AdvNhaCungCap.ValueChanged += handler;
                }
            }
        }

        internal virtual ADVAccount AdvTaiKhoanNo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTaiKhoanNo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTaiKhoanNo = value;
            }
        }

        internal virtual ADVAccount AdvTaiKhoanThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTaiKhoanThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTaiKhoanThue = value;
            }
        }

        internal virtual C1DockingTab C1DockingTab1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTab1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTab1 = value;
            }
        }

        internal virtual C1DockingTab C1DockingTab2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTab2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTab2 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage1 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage2 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage3 = value;
            }
        }

        internal virtual ComboBox CboLoaiHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiHoaDon_SelectedIndexChanged);
                if (this._CboLoaiHoaDon != null)
                {
                    this._CboLoaiHoaDon.SelectedIndexChanged -= handler;
                }
                this._CboLoaiHoaDon = value;
                if (this._CboLoaiHoaDon != null)
                {
                    this._CboLoaiHoaDon.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual ComboBox CboLoaiIn
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiIn;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiIn_SelectedIndexChanged);
                if (this._CboLoaiIn != null)
                {
                    this._CboLoaiIn.SelectedIndexChanged -= handler;
                }
                this._CboLoaiIn = value;
                if (this._CboLoaiIn != null)
                {
                    this._CboLoaiIn.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual ComboBox CboLoaiTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiTien_SelectedIndexChanged);
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged -= handler;
                }
                this._CboLoaiTien = value;
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdAdd
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAdd;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAdd_Click);
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click -= handler;
                }
                this._CmdAdd = value;
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click += handler;
                }
            }
        }

        internal virtual Button CmdAddRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAddRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAddRow_Click);
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click -= handler;
                }
                this._CmdAddRow = value;
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdBoGhiSo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdBoGhiSo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdBoGhiSo_Click);
                if (this._CmdBoGhiSo != null)
                {
                    this._CmdBoGhiSo.Click -= handler;
                }
                this._CmdBoGhiSo = value;
                if (this._CmdBoGhiSo != null)
                {
                    this._CmdBoGhiSo.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdDel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDel_Click);
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click -= handler;
                }
                this._CmdDel = value;
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click += handler;
                }
            }
        }

        internal virtual Button CmdDelRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDelRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDelRow_Click);
                if (this._CmdDelRow != null)
                {
                    this._CmdDelRow.Click -= handler;
                }
                this._CmdDelRow = value;
                if (this._CmdDelRow != null)
                {
                    this._CmdDelRow.Click += handler;
                }
            }
        }

        internal virtual Button CmdDTThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDTThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDTThue_Click);
                if (this._CmdDTThue != null)
                {
                    this._CmdDTThue.Click -= handler;
                }
                this._CmdDTThue = value;
                if (this._CmdDTThue != null)
                {
                    this._CmdDTThue.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdEdit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdEdit_Click);
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click -= handler;
                }
                this._CmdEdit = value;
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdFind
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdFind;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdFind_Click);
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click -= handler;
                }
                this._CmdFind = value;
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdGhiSo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdGhiSo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdGhiSo_Click);
                if (this._CmdGhiSo != null)
                {
                    this._CmdGhiSo.Click -= handler;
                }
                this._CmdGhiSo = value;
                if (this._CmdGhiSo != null)
                {
                    this._CmdGhiSo.Click += handler;
                }
            }
        }

        internal virtual ToolStripDropDownButton CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdPrint_Click);
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click -= handler;
                }
                this._CmdPrint = value;
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdSave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdSave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdSave_Click);
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click -= handler;
                }
                this._CmdSave = value;
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click += handler;
                }
            }
        }

        internal virtual Button CmdSearchPhieuNhap
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdSearchPhieuNhap;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdSearchPhieuNhap_Click);
                if (this._CmdSearchPhieuNhap != null)
                {
                    this._CmdSearchPhieuNhap.Click -= handler;
                }
                this._CmdSearchPhieuNhap = value;
                if (this._CmdSearchPhieuNhap != null)
                {
                    this._CmdSearchPhieuNhap.Click += handler;
                }
            }
        }

        internal virtual ToolStripMenuItem CmdTimNhapKhau
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdTimNhapKhau;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdTimNhapKhau_Click);
                if (this._CmdTimNhapKhau != null)
                {
                    this._CmdTimNhapKhau.Click -= handler;
                }
                this._CmdTimNhapKhau = value;
                if (this._CmdTimNhapKhau != null)
                {
                    this._CmdTimNhapKhau.Click += handler;
                }
            }
        }

        internal virtual ToolStripMenuItem CmdTimNhapKho
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdTimNhapKho;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdTimNhapKho_Click);
                if (this._CmdTimNhapKho != null)
                {
                    this._CmdTimNhapKho.Click -= handler;
                }
                this._CmdTimNhapKho = value;
                if (this._CmdTimNhapKho != null)
                {
                    this._CmdTimNhapKho.Click += handler;
                }
            }
        }

        internal virtual ContextMenuStrip CmdTimPhieuNhap
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdTimPhieuNhap;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdTimPhieuNhap = value;
            }
        }

        internal virtual ToolStripButton CmdUnsave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdUnsave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdUnsave_Click);
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click -= handler;
                }
                this._CmdUnsave = value;
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click += handler;
                }
            }
        }

        public bool EnabledControl
        {
            get
            {
                return this.mEnabledControl;
            }
            set
            {
                this.mEnabledControl = value;
                this.CmdAdd.Enabled = !value & this.mAllowAdd;
                this.CmdEdit.Enabled = !value & this.mAllowEdit;
                this.CmdSave.Enabled = value;
                this.CmdUnsave.Enabled = value;
                this.CmdDel.Enabled = !value & this.mAllowDel;
                this.CmdFind.Enabled = !value;
                this.CmdExit.Enabled = !value;
                this.CmdAddRow.Enabled = value;
                this.CmdDelRow.Enabled = value;
                this.CmdPrint.Enabled = !value;
                this.TxtSoChungTu.ReadOnly = !value;
                this.TxtNgayChungTu.Enabled = value;
                this.CboLoaiTien.Enabled = value;
                this.CboLoaiIn.Enabled = value;
                this.txtTyGia.ReadOnly = !value;
                this.TxtDienGiai.ReadOnly = !value;
                this.AdvNhaCungCap.ReadOnly = !value;
                this.AdvTaiKhoanNo.ReadOnly = !value;
                this.AdvTaiKhoanThue.ReadOnly = !value;
                this.CmdSearchPhieuNhap.Enabled = value;
                this.txtMauHoaDon.ReadOnly = !value;
                this.TxtSoHoaDon.ReadOnly = !value;
                this.TxtSoSeri.ReadOnly = !value;
                this.TxtNgayHoaDon.Enabled = value;
                this.txtMST.ReadOnly = !value;
                this.CboLoaiHoaDon.Enabled = value;
                this.txtHinhThucThanhToan.ReadOnly = !value;
            }
        }

        internal virtual GroupBox GrpHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GrpHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GrpHoaDon = value;
            }
        }

        internal virtual ToolStripMenuItem InPhieuTraHangToolStripMenuItem
        {
            [DebuggerNonUserCode]
            get
            {
                return this._InPhieuTraHangToolStripMenuItem;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.InPhieuTraHangToolStripMenuItem_Click);
                if (this._InPhieuTraHangToolStripMenuItem != null)
                {
                    this._InPhieuTraHangToolStripMenuItem.Click -= handler;
                }
                this._InPhieuTraHangToolStripMenuItem = value;
                if (this._InPhieuTraHangToolStripMenuItem != null)
                {
                    this._InPhieuTraHangToolStripMenuItem.Click += handler;
                }
            }
        }

        internal virtual ToolStripMenuItem InToolStripMenuItem
        {
            [DebuggerNonUserCode]
            get
            {
                return this._InToolStripMenuItem;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.InToolStripMenuItem_Click);
                if (this._InToolStripMenuItem != null)
                {
                    this._InToolStripMenuItem.Click -= handler;
                }
                this._InToolStripMenuItem = value;
                if (this._InToolStripMenuItem != null)
                {
                    this._InToolStripMenuItem.Click += handler;
                }
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label10
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label10;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label10 = value;
            }
        }

        internal virtual Label Label11
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label11;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label11 = value;
            }
        }

        internal virtual Label Label12
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label12;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label12 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label14
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label14;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.Label14_Click);
                if (this._Label14 != null)
                {
                    this._Label14.Click -= handler;
                }
                this._Label14 = value;
                if (this._Label14 != null)
                {
                    this._Label14.Click += handler;
                }
            }
        }

        internal virtual Label Label15
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label15;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label15 = value;
            }
        }

        internal virtual Label Label16
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label16;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label16 = value;
            }
        }

        internal virtual Label Label17
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label17;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label17 = value;
            }
        }

        internal virtual Label Label18
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label18;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label18 = value;
            }
        }

        internal virtual Label Label19
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label19;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label19 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label20
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label20;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label20 = value;
            }
        }

        internal virtual Label Label21
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label21;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label21 = value;
            }
        }

        internal virtual Label Label22
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label22;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label22 = value;
            }
        }

        internal virtual Label Label23
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label23;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label23 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label35
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label35;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label35 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Label Label6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label6 = value;
            }
        }

        internal virtual Label Label7
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label7;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label7 = value;
            }
        }

        internal virtual Label Label8
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label8;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.Label14_Click);
                if (this._Label8 != null)
                {
                    this._Label8.Click -= handler;
                }
                this._Label8 = value;
                if (this._Label8 != null)
                {
                    this._Label8.Click += handler;
                }
            }
        }

        internal virtual Label Label9
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label9;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label9 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual C1DockingTab TabDetails
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabDetails;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabDetails = value;
            }
        }

        internal virtual ToolStrip ToolStrip1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStrip1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStrip1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripButton1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton1 = value;
            }
        }

        internal virtual ToolStripButton ToolStripButton2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator3 = value;
            }
        }

        internal virtual C1NumericEdit TxtChietKhau
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtChietKhau;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtChietKhau = value;
            }
        }

        internal virtual C1NumericEdit TxtChietKhauNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtChietKhauNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtChietKhauNT = value;
            }
        }

        internal virtual TextBox TxtDiaChiThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDiaChiThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDiaChiThue = value;
            }
        }

        internal virtual TextBox TxtDienGiai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDienGiai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDienGiai = value;
            }
        }

        internal virtual TextBox txtHinhThucThanhToan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtHinhThucThanhToan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._txtHinhThucThanhToan = value;
            }
        }

        internal virtual TextBox txtMauHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtMauHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._txtMauHoaDon = value;
            }
        }

        internal virtual TextBox txtMST
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtMST;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._txtMST = value;
            }
        }

        internal virtual DateTimePicker TxtNgayChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayChungTu = value;
            }
        }

        internal virtual DateTimePicker TxtNgayChungTuNhap
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayChungTuNhap;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayChungTuNhap = value;
            }
        }

        internal virtual DateTimePicker TxtNgayHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayHoaDon = value;
            }
        }

        internal virtual TextBox TxtSoChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoChungTu = value;
            }
        }

        internal virtual TextBox TxtSoChungTuNhap
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoChungTuNhap;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoChungTuNhap = value;
            }
        }

        internal virtual TextBox TxtSoHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoHoaDon = value;
            }
        }

        internal virtual TextBox TxtSoSeri
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoSeri;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoSeri = value;
            }
        }

        internal virtual TextBox TxtTenDoiTuongThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTenDoiTuongThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTenDoiTuongThue = value;
            }
        }

        internal virtual C1NumericEdit TxtThueSuat
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtThueSuat;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtThueSuat_ValueChanged);
                if (this._TxtThueSuat != null)
                {
                    this._TxtThueSuat.ValueChanged -= handler;
                }
                this._TxtThueSuat = value;
                if (this._TxtThueSuat != null)
                {
                    this._TxtThueSuat.ValueChanged += handler;
                }
            }
        }

        internal virtual C1NumericEdit TxtTienHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienHang = value;
            }
        }

        internal virtual C1NumericEdit TxtTienHangNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienHangNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienHangNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTienThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienThue = value;
            }
        }

        internal virtual C1NumericEdit TxtTienThueNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienThueNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienThueNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTongThanhToan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongThanhToan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongThanhToan = value;
            }
        }

        internal virtual C1NumericEdit TxtTongThanhToanNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongThanhToanNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongThanhToanNT = value;
            }
        }

        internal virtual C1NumericEdit txtTyGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtTyGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._txtTyGia = value;
            }
        }

        public virtual C1.Win.C1FlexGrid.C1FlexGrid VSlist
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlist;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSList_BeforeEdit);
                RowColEventHandler handler2 = new RowColEventHandler(this.VSList_CellButtonClick);
                RowColEventHandler handler3 = new RowColEventHandler(this.VSList_AfterEdit);
                if (this._VSlist != null)
                {
                    this._VSlist.BeforeEdit -= handler;
                    this._VSlist.CellButtonClick -= handler2;
                    this._VSlist.AfterEdit -= handler3;
                }
                this._VSlist = value;
                if (this._VSlist != null)
                {
                    this._VSlist.BeforeEdit += handler;
                    this._VSlist.CellButtonClick += handler2;
                    this._VSlist.AfterEdit += handler3;
                }
            }
        }
    }
}

